pub trait Decoder: Read {
Show 14 methods
fn reset_ds_cur_val(&mut self);
fn read_ds_clock(&mut self) -> u32;
fn read_ds_len(&mut self) -> u32;
fn read_left_id(&mut self) -> ID;
fn read_right_id(&mut self) -> ID;
fn read_client(&mut self) -> ClientID;
fn read_info(&mut self) -> u8;
fn read_parent_info(&mut self) -> bool;
fn read_type_ref(&mut self) -> TypeRefs;
fn read_len(&mut self) -> u32;
fn read_any(&mut self) -> Any;
fn read_json(&mut self) -> Any;
fn read_key(&mut self) -> Rc<str>;
fn read_to_end(&mut self) -> &[u8]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
;
}
Expand description
Trait used by lib0 decoders. Natively lib0 encoding supports two versions:
- 1st version (implemented in Yrs) uses simple optimization techniques like var int encoding.
- 2nd version optimizes bigger batches of blocks by using run-length encoding.
Both of these define a common set of operations defined in this trait.
Required Methods
fn reset_ds_cur_val(&mut self)
fn reset_ds_cur_val(&mut self)
Reset the value of current delete set state.
fn read_ds_clock(&mut self) -> u32
fn read_ds_clock(&mut self) -> u32
Read next DeleteSet clock value.
fn read_ds_len(&mut self) -> u32
fn read_ds_len(&mut self) -> u32
Read the number of clients stored in encoded DeleteSet.
fn read_left_id(&mut self) -> ID
fn read_left_id(&mut self) -> ID
Read left origin of a currently decoded [Block].
fn read_right_id(&mut self) -> ID
fn read_right_id(&mut self) -> ID
Read right origin of a currently decoded [Block].
fn read_client(&mut self) -> ClientID
fn read_client(&mut self) -> ClientID
Read currently decoded client identifier.
fn read_parent_info(&mut self) -> bool
fn read_parent_info(&mut self) -> bool
Read bit flags determining type of parent of a currently decoded [Block].
fn read_type_ref(&mut self) -> TypeRefs
fn read_type_ref(&mut self) -> TypeRefs
Read type ref info of a currently decoded [Block] parent.
Decode a JSON-like data type. It’s a complex type which is an extension of native JavaScript Object Notation.
Decode an embedded JSON string into Any struct. It’s a complex type which is an extension of native JavaScript Object Notation.