pub struct AppOperation {
pub type_id: u8,
pub op_code: u8,
pub source_node: u32,
pub timestamp: u64,
pub payload: Vec<u8>,
}Expand description
App-layer delta operation.
Used for efficient sync of registered document types.
Fields§
§type_id: u8Document type ID (0xC0-0xCF).
op_code: u8Operation code (type-specific, 0-255).
source_node: u32Source node that created this operation.
timestamp: u64Timestamp of the operation.
payload: Vec<u8>Operation payload (type-specific).
Implementations§
Source§impl AppOperation
impl AppOperation
Sourcepub fn new(type_id: u8, op_code: u8, source_node: u32, timestamp: u64) -> Self
pub fn new(type_id: u8, op_code: u8, source_node: u32, timestamp: u64) -> Self
Create a new app operation.
Sourcepub fn with_payload(self, payload: Vec<u8>) -> Self
pub fn with_payload(self, payload: Vec<u8>) -> Self
Create with payload.
Sourcepub fn is_app_op_type(op_type: u8) -> bool
pub fn is_app_op_type(op_type: u8) -> bool
Check if this is a valid app-layer operation type.
Sourcepub fn op_type_byte(&self) -> u8
pub fn op_type_byte(&self) -> u8
Get the operation type byte for wire encoding.
Trait Implementations§
Source§impl Clone for AppOperation
impl Clone for AppOperation
Source§fn clone(&self) -> AppOperation
fn clone(&self) -> AppOperation
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 moreAuto Trait Implementations§
impl Freeze for AppOperation
impl RefUnwindSafe for AppOperation
impl Send for AppOperation
impl Sync for AppOperation
impl Unpin for AppOperation
impl UnwindSafe for AppOperation
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