# SharingController

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-designer/sharing/struct-sharingcontroller/

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

```rust
struct SharingController
```

Retain this controller while sharing. Call `poll` on the UI thread (the stock workspace does
so from its existing timer). A document/tab change detaches the old room before any reply is
applied. All operations are revision-checked and leave source drafts intact on failure.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer/sharing.rs#L144)

## Members

- [`host`](#function-host)
- [`join`](#function-join)
- [`resume`](#function-resume)
- [`status`](#function-status)
- [`set_cursor`](#function-set_cursor)
- [`pending_source`](#function-pending_source)
- [`pending_local_source`](#function-pending_local_source)
- [`invite`](#function-invite)
- [`set_member`](#function-set_member)
- [`checkpoint`](#function-checkpoint)
- [`refresh_room`](#function-refresh_room)
- [`accept_snapshot`](#function-accept_snapshot)
- [`disconnect`](#function-disconnect)
- [`poll`](#function-poll)

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

### host

```rust
fn host(session: &Rc<RefCell<DesignerSession>>, options: SharingOptions) -> Result<Rc<Self>, String>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer/sharing.rs#L164)

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

### join

```rust
fn join(session: &Rc<RefCell<DesignerSession>>, invitation: String, options: SharingOptions) -> Result<Rc<Self>, String>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer/sharing.rs#L170)

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

### resume

```rust
fn resume(session: &Rc<RefCell<DesignerSession>>, options: SharingOptions) -> Result<Rc<Self>, String>
```



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

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

### status

```rust
fn status(self: &Self) -> SharingStatus
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer/sharing.rs#L253)

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

### set_cursor

```rust
fn set_cursor(self: &Self, cursor: Option<Cursor>) -> Result<(), String>
```

Cursor coordinates are artboard-local logical units, independent of viewport zoom/scroll.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer/sharing.rs#L257)

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

### pending_source

```rust
fn pending_source(self: &Self) -> Option<String>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer/sharing.rs#L267)

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

### pending_local_source

```rust
fn pending_local_source(self: &Self) -> Option<String>
```

The saved offline draft offered as a resolution when resuming after a restart.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer/sharing.rs#L278)

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

### invite

```rust
fn invite(self: &Self, role: Role) -> Result<(), String>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer/sharing.rs#L285)

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

### set_member

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



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer/sharing.rs#L291)

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

### checkpoint

```rust
fn checkpoint(self: &Self) -> Result<(), String>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer/sharing.rs#L298)

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

### refresh_room

```rust
fn refresh_room(self: &Self) -> Result<(), String>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer/sharing.rs#L319)

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

### accept_snapshot

```rust
fn accept_snapshot(self: &Self, expected_revision: u64, resolved_source: Option<String>) -> Result<(), String>
```

The stock UI presents the exact remote source and a resolution field before this call.
`None` restores the saved session draft; pass `Some(pending_source())` to explicitly adopt
the remote document instead. A revision pin prevents applying that decision if the local
document changes during I/O.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer/sharing.rs#L352)

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

### disconnect

```rust
fn disconnect(self: &Self)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer/sharing.rs#L389)

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

### poll

```rust
fn poll(self: &Self) -> Result<bool, String>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Designer/sharing.rs#L649)

## Trait implementations

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

## Availability

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