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
CommittedDocument
Original committed history from this SDK channel, applied by its document owner.
Context
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.
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.
DocumentSnapshotRequested
The broker selected this connection as the sole snapshot responder for a late joiner on the same document route.
Handoff
The shell asked this instance for a step of moving its window to another workspace. Session-local control; never from a peer.
Fields
request: HandoffRequestRemoteCursorMoved
RemotePresenceUpdate
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.
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
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: ArtifactIdEchoes 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.
Invocation
One capability-checked invocation addressed to this application connection by the session action broker.
Fields
invocation: InvocationIdcontext: 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.
RemoteAction
The session’s answer to a CollabRequest::RemoteAction.
Fields
message: RemoteActionMessageActionCatalogue
Fields
surfaces: Vec<BrokerActionSurface>ActionDirectoryPage
PublishedActionResolution
ManagedInvocationObservation
Original attempt custody remains with this result through final clone destruction. Only the sender’s physical barrier can acknowledge it.
Fields
result: ManagedAttemptResultPublishedInvocationResult
InstalledApplicationLaunchResult
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
TaskRunCancellation
TaskRunControl
TaskRunReportResult
WorkspaceControl
NativeMediaCommandResult
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.
RealtimeCommandResult
NearbyTransferCommandResult
Realtime(RealtimeEvent)
Implementations§
§impl CollabEvent
impl CollabEvent
pub fn document_mutation(
&self,
) -> Option<Result<DocumentMutation, DocumentMutationError>>
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
impl Clone for CollabEvent
§fn clone(&self) -> CollabEvent
fn clone(&self) -> CollabEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for CollabEvent
impl RefUnwindSafe for CollabEvent
impl Send for CollabEvent
impl Sync for CollabEvent
impl Unpin for CollabEvent
impl UnsafeUnpin for CollabEvent
impl UnwindSafe for CollabEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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)
fn as_any(&self) -> &(dyn Any + 'static)
&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)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&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
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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