Struct DecoderV1
pub struct DecoderV1<'a> { /* private fields */ }Expand description
Version 1 of lib0 decoder.
Implementations§
Trait Implementations§
§impl<'a> Decoder for DecoderV1<'a>
impl<'a> Decoder for DecoderV1<'a>
§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_len(&mut self) -> Result<u32, Error>
fn read_ds_len(&mut self) -> Result<u32, Error>
Read the number of clients stored in encoded DeleteSet.
§fn read_left_id(&mut self) -> Result<ID, Error>
fn read_left_id(&mut self) -> Result<ID, Error>
Read left origin of a currently decoded [Block].
§fn read_right_id(&mut self) -> Result<ID, Error>
fn read_right_id(&mut self) -> Result<ID, Error>
Read right origin of a currently decoded [Block].
§fn read_client(&mut self) -> Result<u64, Error>
fn read_client(&mut self) -> Result<u64, Error>
Read currently decoded client identifier.
§fn read_parent_info(&mut self) -> Result<bool, Error>
fn read_parent_info(&mut self) -> Result<bool, Error>
Read bit flags determining type of parent of a currently decoded [Block].
§fn read_type_ref(&mut self) -> Result<u8, Error>
fn read_type_ref(&mut self) -> Result<u8, Error>
Read type ref info of a currently decoded [Block] parent.
§fn read_any(&mut self) -> Result<Any, Error>
fn read_any(&mut self) -> Result<Any, Error>
Decode a JSON-like data type. It’s a complex type which is an extension of native JavaScript
Object Notation.
§fn read_json(&mut self) -> Result<Any, Error>
fn read_json(&mut self) -> Result<Any, Error>
Decode an embedded JSON string into Any struct. It’s a complex type which is an extension
of native JavaScript Object Notation.
§fn read_to_end(&mut self) -> Result<&[u8], Error>
fn read_to_end(&mut self) -> Result<&[u8], Error>
Consume a rest of the decoded buffer data and return it without parsing.
§impl<'a> Read for DecoderV1<'a>
impl<'a> Read for DecoderV1<'a>
fn read_exact(&mut self, len: usize) -> Result<&[u8], Error>
§fn read_u32_be(&mut self) -> Result<u32, Error>
fn read_u32_be(&mut self) -> Result<u32, Error>
Read 4 bytes as unsigned integer in big endian order.
(most significant byte first)
§fn read_var<T>(&mut self) -> Result<T, Error>where
T: VarInt,
fn read_var<T>(&mut self) -> Result<T, Error>where
T: VarInt,
Read unsigned integer with variable length. Read more
§fn read_var_signed<T>(&mut self) -> Result<Signed<T>, Error>where
T: SignedVarInt,
fn read_var_signed<T>(&mut self) -> Result<Signed<T>, Error>where
T: SignedVarInt,
Read unsigned integer with variable length. Read more
§fn read_string(&mut self) -> Result<&str, Error>
fn read_string(&mut self) -> Result<&str, Error>
Read string of variable length.
Auto Trait Implementations§
impl<'a> Freeze for DecoderV1<'a>
impl<'a> RefUnwindSafe for DecoderV1<'a>
impl<'a> Send for DecoderV1<'a>
impl<'a> Sync for DecoderV1<'a>
impl<'a> Unpin for DecoderV1<'a>
impl<'a> UnwindSafe for DecoderV1<'a>
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
§impl<T> CompatExt for T
impl<T> CompatExt 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>
Converts
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>
Converts
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