pub enum ProtocolMessage {
JoinRequest {
crdt: CrdtType,
room_id: String,
auth: Vec<u8>,
version: Vec<u8>,
},
JoinResponseOk {
crdt: CrdtType,
room_id: String,
permission: Permission,
version: Vec<u8>,
extra: Option<Vec<u8>>,
},
JoinError {
crdt: CrdtType,
room_id: String,
code: JoinErrorCode,
message: String,
receiver_version: Option<Vec<u8>>,
app_code: Option<String>,
},
DocUpdate {
crdt: CrdtType,
room_id: String,
updates: Vec<Vec<u8>>,
},
DocUpdateFragmentHeader {
crdt: CrdtType,
room_id: String,
batch_id: BatchId,
fragment_count: u64,
total_size_bytes: u64,
},
DocUpdateFragment {
crdt: CrdtType,
room_id: String,
batch_id: BatchId,
index: u64,
fragment: Vec<u8>,
},
UpdateError {
crdt: CrdtType,
room_id: String,
code: UpdateErrorCode,
message: String,
batch_id: Option<BatchId>,
app_code: Option<String>,
},
Leave {
crdt: CrdtType,
room_id: String,
},
}Expand description
All protocol messages as a single enum. Each variant includes the common
crdt magic and room_id as part of the struct fields.
Variants§
JoinRequest
JoinResponseOk
Fields
§
permission: PermissionJoinError
Fields
§
code: JoinErrorCodeDocUpdate
DocUpdateFragmentHeader
DocUpdateFragment
UpdateError
Fields
§
code: UpdateErrorCodeLeave
Trait Implementations§
Source§impl Clone for ProtocolMessage
impl Clone for ProtocolMessage
Source§fn clone(&self) -> ProtocolMessage
fn clone(&self) -> ProtocolMessage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProtocolMessage
impl Debug for ProtocolMessage
Source§impl PartialEq for ProtocolMessage
impl PartialEq for ProtocolMessage
impl Eq for ProtocolMessage
impl StructuralPartialEq for ProtocolMessage
Auto Trait Implementations§
impl Freeze for ProtocolMessage
impl RefUnwindSafe for ProtocolMessage
impl Send for ProtocolMessage
impl Sync for ProtocolMessage
impl Unpin for ProtocolMessage
impl UnwindSafe for ProtocolMessage
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
Mutably borrows from an owned value. Read more