Struct yrs::updates::decoder::DecoderV1

source ·
pub struct DecoderV1<'a> { /* private fields */ }
Expand description

Version 1 of lib0 decoder.

Implementations§

source§

impl<'a> DecoderV1<'a>

source

pub fn new(cursor: Cursor<'a>) -> Self

Trait Implementations§

source§

impl<'a> Decoder for DecoderV1<'a>

source§

fn reset_ds_cur_val(&mut self)

Reset the value of current delete set state.
source§

fn read_ds_clock(&mut self) -> Result<u32, Error>

Read next DeleteSet clock value.
source§

fn read_ds_len(&mut self) -> Result<u32, Error>

Read the number of clients stored in encoded DeleteSet.
source§

fn read_left_id(&mut self) -> Result<ID, Error>

Read left origin of a currently decoded [Block].
source§

fn read_right_id(&mut self) -> Result<ID, Error>

Read right origin of a currently decoded [Block].
source§

fn read_client(&mut self) -> Result<ClientID, Error>

Read currently decoded client identifier.
source§

fn read_info(&mut self) -> Result<u8, Error>

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

fn read_parent_info(&mut self) -> Result<bool, Error>

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

fn read_type_ref(&mut self) -> Result<u8, Error>

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

fn read_len(&mut self) -> Result<u32, Error>

Read length parameter.
source§

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.
source§

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.
source§

fn read_key(&mut self) -> Result<Arc<str>, Error>

Read key string.
source§

fn read_to_end(&mut self) -> Result<&[u8], Error>

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

impl<'a> From<&'a [u8]> for DecoderV1<'a>

source§

fn from(buf: &'a [u8]) -> Self

Converts to this type from the input type.
source§

impl<'a> From<Cursor<'a>> for DecoderV1<'a>

source§

fn from(cursor: Cursor<'a>) -> Self

Converts to this type from the input type.
source§

impl<'a> Read for DecoderV1<'a>

source§

fn read_u8(&mut self) -> Result<u8, Error>

Read a single byte.
source§

fn read_exact(&mut self, len: usize) -> Result<&[u8], Error>

source§

fn read_buf(&mut self) -> Result<&[u8], Error>

Read a variable length buffer.
source§

fn read_u16(&mut self) -> Result<u16, Error>

Read 2 bytes as unsigned integer
source§

fn read_u32(&mut self) -> Result<u32, Error>

Read 4 bytes as unsigned integer
source§

fn read_u32_be(&mut self) -> Result<u32, Error>

Read 4 bytes as unsigned integer in big endian order. (most significant byte first)
source§

fn read_var<T: VarInt>(&mut self) -> Result<T, Error>

Read unsigned integer with variable length. Read more
source§

fn read_var_signed<T: SignedVarInt>(&mut self) -> Result<Signed<T>, Error>

Read unsigned integer with variable length. Read more
source§

fn read_string(&mut self) -> Result<&str, Error>

Read string of variable length.
source§

fn read_f32(&mut self) -> Result<f32, Error>

Read float32 in big endian order
source§

fn read_f64(&mut self) -> Result<f64, Error>

Read float64 in big endian order
source§

fn read_i64(&mut self) -> Result<i64, Error>

Read BigInt64 in big endian order
source§

fn read_u64(&mut self) -> Result<u64, Error>

read BigUInt64 in big endian order

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.