RoomStore
struct · ferroui-designer-collaboration-host · v0.5.0
struct RoomStore
One process owns each storage directory (OS file lock). Clones should share an Arc<RoomStore>.
The mutex covers validation through durable commit, so authenticated concurrent calls cannot
acknowledge a lost update or race a role change. Presence uses the receiver's monotonic clock.
Members
openauthorizeauthorize_adminauthorize_scopecreatecreate_checkedstateinviteinvite_checkedjoinjoin_checkedset_memberset_member_checkedexchangeexchange_checkedcheckpointcheckpoint_checkedcheckpoint_resolvedcheckpoint_resolved_checked
open
fn open(path: impl AsRef<Path>, admin: &Secret) -> Result<Self>
authorize
fn authorize(self: &Self, credentials: &Credentials) -> Result<Role>
authorize_admin
fn authorize_admin(self: &Self, admin: &Secret) -> Result<()>
authorize_scope
fn authorize_scope(self: &Self, authority: &Authority) -> Result<()>
create
fn create(self: &Self, request: CreateRequest) -> Result<JoinedRoom>
owner_token is generated by the caller and is the idempotency key. Retrying a lost
response cannot create another room or replace an existing document.
create_checked
fn create_checked(self: &Self, request: CreateRequest, fence: &dyn CommitFence) -> Result<JoinedRoom>
state
fn state(self: &Self, credentials: &Credentials) -> Result<RoomState>
invite
fn invite(self: &Self, credentials: &Credentials, token: Secret, role: Role, expires_in: u64, uses: u32) -> Result<()>
invite_checked
fn invite_checked(self: &Self, credentials: &Credentials, token: Secret, role: Role, expires_in: u64, uses: u32, fence: &dyn CommitFence) -> Result<()>
join
fn join(self: &Self, request: JoinRequest) -> Result<JoinedRoom>
join_checked
fn join_checked(self: &Self, request: JoinRequest, fence: &dyn CommitFence) -> Result<JoinedRoom>
set_member
fn set_member(self: &Self, owner: &Credentials, actor: &str, role: Role, revoked: bool) -> Result<()>
set_member_checked
fn set_member_checked(self: &Self, owner: &Credentials, actor: &str, role: Role, revoked: bool, fence: &dyn CommitFence) -> Result<()>
exchange
fn exchange(self: &Self, credentials: &Credentials, exchange: Exchange) -> Result<ExchangeReply>
exchange_checked
fn exchange_checked(self: &Self, credentials: &Credentials, exchange: Exchange, fence: &dyn CommitFence) -> Result<ExchangeReply>
checkpoint
fn checkpoint(self: &Self, owner: &Credentials, epoch: u64, expected: &VersionVector) -> Result<RoomState>
An owner checkpoints only an exact observed vector. Old clients receive EpochChanged; their offline edits remain intact until they explicitly rebase/discard them.
checkpoint_checked
fn checkpoint_checked(self: &Self, owner: &Credentials, epoch: u64, expected: &VersionVector, fence: &dyn CommitFence) -> Result<RoomState>
checkpoint_resolved
fn checkpoint_resolved(self: &Self, owner: &Credentials, epoch: u64, expected: &VersionVector, source: &str) -> Result<RoomState>
Adopt an explicitly reviewed source at an exact room version. Historical losing operations remain in the old peer checkpoint until each participant reviews the new epoch.
checkpoint_resolved_checked
fn checkpoint_resolved_checked(self: &Self, owner: &Credentials, epoch: u64, expected: &VersionVector, resolved_source: Option<&str>, fence: &dyn CommitFence) -> Result<RoomState>
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnySameClassDefaultsErasedDestructorIntoEither
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.