# RoomStore

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-designer-collaboration-host/struct-roomstore/

**struct** · [`ferroui-designer-collaboration-host`](/docs/0.5.0/api/ferroui-designer-collaboration-host/) · v0.5.0

```rust
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.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Collaboration.Host/rooms.rs#L21)

## Members

- [`open`](#function-open)
- [`authorize`](#function-authorize)
- [`authorize_admin`](#function-authorize_admin)
- [`authorize_scope`](#function-authorize_scope)
- [`create`](#function-create)
- [`create_checked`](#function-create_checked)
- [`state`](#function-state)
- [`invite`](#function-invite)
- [`invite_checked`](#function-invite_checked)
- [`join`](#function-join)
- [`join_checked`](#function-join_checked)
- [`set_member`](#function-set_member)
- [`set_member_checked`](#function-set_member_checked)
- [`exchange`](#function-exchange)
- [`exchange_checked`](#function-exchange_checked)
- [`checkpoint`](#function-checkpoint)
- [`checkpoint_checked`](#function-checkpoint_checked)
- [`checkpoint_resolved`](#function-checkpoint_resolved)
- [`checkpoint_resolved_checked`](#function-checkpoint_resolved_checked)

<a id="function-open"></a>

### open

```rust
fn open(path: impl AsRef<Path>, admin: &Secret) -> Result<Self>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Collaboration.Host/rooms.rs#L30)

<a id="function-authorize"></a>

### authorize

```rust
fn authorize(self: &Self, credentials: &Credentials) -> Result<Role>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Collaboration.Host/rooms.rs#L144)

<a id="function-authorize_admin"></a>

### authorize_admin

```rust
fn authorize_admin(self: &Self, admin: &Secret) -> Result<()>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Collaboration.Host/rooms.rs#L149)

<a id="function-authorize_scope"></a>

### authorize_scope

```rust
fn authorize_scope(self: &Self, authority: &Authority) -> Result<()>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Collaboration.Host/rooms.rs#L157)

<a id="function-create"></a>

### create

```rust
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.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Collaboration.Host/rooms.rs#L178)

<a id="function-create_checked"></a>

### create_checked

```rust
fn create_checked(self: &Self, request: CreateRequest, fence: &dyn CommitFence) -> Result<JoinedRoom>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Collaboration.Host/rooms.rs#L181)

<a id="function-state"></a>

### state

```rust
fn state(self: &Self, credentials: &Credentials) -> Result<RoomState>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Collaboration.Host/rooms.rs#L245)

<a id="function-invite"></a>

### invite

```rust
fn invite(self: &Self, credentials: &Credentials, token: Secret, role: Role, expires_in: u64, uses: u32) -> Result<()>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Collaboration.Host/rooms.rs#L251)

<a id="function-invite_checked"></a>

### invite_checked

```rust
fn invite_checked(self: &Self, credentials: &Credentials, token: Secret, role: Role, expires_in: u64, uses: u32, fence: &dyn CommitFence) -> Result<()>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Collaboration.Host/rooms.rs#L261)

<a id="function-join"></a>

### join

```rust
fn join(self: &Self, request: JoinRequest) -> Result<JoinedRoom>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Collaboration.Host/rooms.rs#L313)

<a id="function-join_checked"></a>

### join_checked

```rust
fn join_checked(self: &Self, request: JoinRequest, fence: &dyn CommitFence) -> Result<JoinedRoom>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Collaboration.Host/rooms.rs#L316)

<a id="function-set_member"></a>

### set_member

```rust
fn set_member(self: &Self, owner: &Credentials, actor: &str, role: Role, revoked: bool) -> Result<()>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Collaboration.Host/rooms.rs#L386)

<a id="function-set_member_checked"></a>

### set_member_checked

```rust
fn set_member_checked(self: &Self, owner: &Credentials, actor: &str, role: Role, revoked: bool, fence: &dyn CommitFence) -> Result<()>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Collaboration.Host/rooms.rs#L395)

<a id="function-exchange"></a>

### exchange

```rust
fn exchange(self: &Self, credentials: &Credentials, exchange: Exchange) -> Result<ExchangeReply>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Collaboration.Host/rooms.rs#L426)

<a id="function-exchange_checked"></a>

### exchange_checked

```rust
fn exchange_checked(self: &Self, credentials: &Credentials, exchange: Exchange, fence: &dyn CommitFence) -> Result<ExchangeReply>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Collaboration.Host/rooms.rs#L429)

<a id="function-checkpoint"></a>

### checkpoint

```rust
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.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Collaboration.Host/rooms.rs#L511)

<a id="function-checkpoint_checked"></a>

### checkpoint_checked

```rust
fn checkpoint_checked(self: &Self, owner: &Credentials, epoch: u64, expected: &VersionVector, fence: &dyn CommitFence) -> Result<RoomState>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Collaboration.Host/rooms.rs#L519)

<a id="function-checkpoint_resolved"></a>

### checkpoint_resolved

```rust
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.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Collaboration.Host/rooms.rs#L530)

<a id="function-checkpoint_resolved_checked"></a>

### checkpoint_resolved_checked

```rust
fn checkpoint_resolved_checked(self: &Self, owner: &Credentials, epoch: u64, expected: &VersionVector, resolved_source: Option<&str>, fence: &dyn CommitFence) -> Result<RoomState>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer.Collaboration.Host/rooms.rs#L539)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `Same`
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
