Skip to main content

CollabEvent

Enum CollabEvent 

pub enum CollabEvent {
Show 33 variants LocalFileClipboardResult { request_id: u64, result: Result<Reply, String>, }, CommittedDocument { route: RouteSpec, read: CommittedDocument, }, Context { collaborators: Vec<Collaborator>, permissions: Vec<String>, }, HistoryAgents { cluster_id: String, agents: Vec<RosterAgent>, }, FollowChanged { peer_id: Option<String>, }, DocumentSnapshotRequested { route: RouteSpec, }, Handoff { request: HandoffRequest, }, RemoteCursorMoved { user_id: String, x: f32, y: f32, }, RemotePresenceUpdate { user_id: String, key: PresenceKey, payload: PresencePayload, }, ActionArrived { type_id: String, payload: Vec<u8>, from_user_id: String, }, ChannelAccess { route: RouteSpec, state: ChannelAccessState, }, Document { envelope: Box<SignedOp>, from_user_id: String, decrypted_payload: Option<Vec<u8>>, }, ScrollbackBatch { artifact: ArtifactId, ops: Vec<Box<SignedOp>>, decrypted_payloads: Vec<Option<Vec<u8>>>, oldest_seq: Option<u64>, exhausted: bool, }, Invocation { id: u64, invocation: InvocationId, resource: String, action: String, argument: Option<String>, actor: String, context: Option<Box<ActionContext>>, }, InvocationCancellation { id: u64, }, RemoteAction { message: RemoteActionMessage, }, ActionCatalogue { surfaces: Vec<BrokerActionSurface>, }, ActionDirectoryPage { request_id: u64, result: Result<ActionDirectoryPage, String>, }, PublishedActionResolution { request_id: u64, result: Result<ActionDirectoryResolution, String>, }, ManagedInvocationObservation { result: ManagedAttemptResult, }, PublishedInvocationResult { request_id: u64, result: Result<(u64, InvocationUpdate), String>, }, InstalledApplicationLaunchResult { request_id: u64, result: Result<(u64, InvocationUpdate), String>, }, TaskRun(TaskRunEnvelope), TaskActionInvocationResult { request_id: u64, result: Result<(u64, InvocationUpdate), String>, }, TaskRunCancellation { request_id: u64, result: Result<bool, String>, }, TaskRunControl { request_id: u64, control: TaskRunControl, }, TaskRunReportResult { request_id: u64, result: Result<(), String>, }, WorkspaceControl { session_id: u64, event: WorkspaceControlEvent, }, NativeMediaCommandResult { request_id: u64, result: Result<Snapshot, String>, }, RecordContent { route: RouteSpec, hash: String, bytes: Vec<u8>, }, RealtimeCommandResult { request_id: u64, result: Result<RealtimeReply, String>, }, NearbyTransferCommandResult { request_id: u64, result: Result<NearbyTransferReply, String>, }, Realtime(RealtimeEvent),
}

Variants§

§

LocalFileClipboardResult

Fields

§request_id: u64
§

CommittedDocument

Original committed history from this SDK channel, applied by its document owner.

§

Context

Fields

§collaborators: Vec<Collaborator>
§permissions: Vec<String>
§

HistoryAgents

The delegated agents on cluster_id’s roster whose person’s root signed the delegation for exactly that device, as the session verified them: who the app’s history names for changes their own device keys signed. Session-local and presentation only.

Fields

§cluster_id: String
§

FollowChanged

Session chrome asked this app to bind its viewport/view mode to a participant, or release that binding. This is local session control: it is never published to collaboration peers.

Fields

§peer_id: Option<String>
§

DocumentSnapshotRequested

The broker selected this connection as the sole snapshot responder for a late joiner on the same document route.

Fields

§

Handoff

The shell asked this instance for a step of moving its window to another workspace. Session-local control; never from a peer.

Fields

§

RemoteCursorMoved

Fields

§user_id: String
§

RemotePresenceUpdate

Fields

§user_id: String
§

ActionArrived

A typed action another app in this room published, delivered to every connection. A receiver decodes it via its own ActionRegistry; an action for a different app decodes to nothing, making room-wide fan-out safe.

from_user_id is who sent the frame, not necessarily who the action says authored it.

Fields

§type_id: String
§payload: Vec<u8>
§from_user_id: String
§

ChannelAccess

What this endpoint can do with one route’s end-to-end encrypted content changed: it was admitted, is waiting for access (a new device before its welcome arrives), was removed, or cannot join. While a route is not open the SDK holds edits and incoming ciphertext on the device instead of dropping them; apps show the state.

§

Document

A validated signed document envelope from another peer. For cleartext routes the mutation kind is inside the outer signed payload. For an MLS route, envelope.payload remains the original signed ciphertext and decrypted_payload holds endpoint-only plaintext after the inner MLS authentication succeeds. A mutation too large for one frame arrives as several signed segments; the SDK delivers it once, after every segment arrived and the reassembled bytes matched their signed digest, with envelope set to the final segment.

Fields

§envelope: Box<SignedOp>
§from_user_id: String
§decrypted_payload: Option<Vec<u8>>

Endpoint-verified typed mutation bytes when they differ from envelope.payload: MLS plaintext, or a mutation reassembled from segments. None for single-frame cleartext envelopes (read directly from envelope.payload) and for broker events, which never possess MLS keys.

§

ScrollbackBatch

Response to a CollabRequest::FetchScrollback: a page of previously-validated ops plus exhausted.

Targeted send — unlike every other event here, the broker writes this only to the connection that issued the matching request.

Fields

§artifact: ArtifactId

Echoes FetchScrollback::artifact so multiple in-flight fetches route to the right history view.

§ops: Vec<Box<SignedOp>>

Ascending seq order. Empty when the broker has no matching range (typically evicted by compaction).

§decrypted_payloads: Vec<Option<Vec<u8>>>

Endpoint-decrypted payload parallel to ops. Brokers leave this empty because they have no MLS keys; SDK endpoints populate one slot per op and drop undecryptable encrypted entries.

§oldest_seq: Option<u64>

Oldest seq the host returned, before the endpoint dropped ops it could not use yet (an incomplete segment), so paging resumes below it rather than re-fetching or stopping early.

§exhausted: bool
§

Invocation

One capability-checked invocation addressed to this application connection by the session action broker.

Fields

§id: u64
§invocation: InvocationId
§resource: String
§action: String
§argument: Option<String>
§actor: String
§context: Option<Box<ActionContext>>

Broker-owned task/session provenance. The concrete application resource and action remain authoritative; this only supplies the surrounding purpose and work-group for durable history.

§

InvocationCancellation

The invocation owner requested cooperative cancellation. Delivered at most once; the app-side job decides the next safe stopping boundary.

Fields

§id: u64
§

RemoteAction

The session’s answer to a CollabRequest::RemoteAction.

Fields

§

ActionCatalogue

Fields

§

ActionDirectoryPage

Fields

§request_id: u64
§result: Result<ActionDirectoryPage, String>
§

PublishedActionResolution

Fields

§request_id: u64
§result: Result<ActionDirectoryResolution, String>
§

ManagedInvocationObservation

Original attempt custody remains with this result through final clone destruction. Only the sender’s physical barrier can acknowledge it.

§

PublishedInvocationResult

Fields

§request_id: u64
§

InstalledApplicationLaunchResult

Fields

§request_id: u64
§

TaskRun(TaskRunEnvelope)

A run addressed to this admitted agent. The envelope is broker-minted and contains a lease, not a caller-selected authority token.

§

TaskActionInvocationResult

Fields

§request_id: u64
§

TaskRunCancellation

Fields

§request_id: u64
§result: Result<bool, String>
§

TaskRunControl

Fields

§request_id: u64
§control: TaskRunControl
§

TaskRunReportResult

Fields

§request_id: u64
§result: Result<(), String>
§

WorkspaceControl

Fields

§session_id: u64
§event: WorkspaceControlEvent
§

NativeMediaCommandResult

Fields

§request_id: u64
§

RecordContent

Content the record on route references arrived: an answer to CollabRequest::WantContent, or content another app on the record offered. The bytes are verified against hash before use.

Fields

§hash: String
§bytes: Vec<u8>
§

RealtimeCommandResult

Fields

§request_id: u64
§

NearbyTransferCommandResult

Fields

§request_id: u64
§

Realtime(RealtimeEvent)

Implementations§

§

impl CollabEvent

pub fn document_mutation( &self, ) -> Option<Result<DocumentMutation, DocumentMutationError>>

Decode the typed payload of a validated document event. Returns None for presence, context, action, and scrollback events.

Trait Implementations§

§

impl Clone for CollabEvent

§

fn clone(&self) -> CollabEvent

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for CollabEvent

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> Fruit for T
where T: Send + Downcast,

§

impl<T> MaybeSendSync for T
where T: Send + Sync + ?Sized,

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T

§

impl<T> WasmNotSync for T
where T: Sync,