Trait yrs::updates::decoder::Decoder[][src]

pub trait Decoder: Read {
Show 13 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) -> u64;
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_key(&mut self) -> &str;
fn read_to_end(&mut self) -> &[u8];
}
Expand description

Trait used by lib0 decoders. Natively lib0 encoding supports two versions:

  1. 1st version (implemented in Yrs) uses simple optimization techniques like var int encoding.
  2. 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

Reset the value of current delete set state.

Read next DeleteSet clock value.

Read the number of clients stored in encoded DeleteSet.

Read left origin of a currently decoded [Block].

Read right origin of a currently decoded [Block].

Read currently decoded client identifier.

Read info bit flags of a currently decoded [Block].

Read bit flags determining type of parent of a currently decoded [Block].

Read type ref info of a currently decoded [Block] parent.

Read length parameter.

Decode a JSON-like data type. It’s a complex type which is an extension of native JavaScript Object Notation.

Read key string.

Consume a rest of the decoded buffer data and return it without parsing.

Implementors