Development Documentation (main branch) - For stable release docs, see docs.rs/eidetica

DecoderV2

Struct DecoderV2 

pub struct DecoderV2<'a> { /* private fields */ }
Expand description

Version 2 of lib0 decoder.

Implementations§

§

impl<'a> DecoderV2<'a>

pub fn new(cursor: Cursor<'a>) -> Result<DecoderV2<'a>, Error>

Trait Implementations§

§

impl<'a> Decoder for DecoderV2<'a>

§

fn reset_ds_cur_val(&mut self)

Reset the value of current delete set state.
§

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

Read next DeleteSet clock value.
§

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>

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

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>

Read currently decoded client identifier.
§

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

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

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>

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

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

Read length parameter.
§

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>

Decode an embedded JSON string into Any struct. It’s a complex type which is an extension of native JavaScript Object Notation.
§

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

Read key string.
§

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 DecoderV2<'a>

§

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

§

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

Read a single byte.
§

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

Read string of variable length.
§

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

Read a variable length buffer.
§

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

Read 2 bytes as unsigned integer
§

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

Read 4 bytes as unsigned integer
§

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,

Read unsigned integer with variable length. Read more
§

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

Read unsigned integer with variable length. Read more
§

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

Read float32 in big endian order
§

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

Read float64 in big endian order
§

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

Read BigInt64 in big endian order
§

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

read BigUInt64 in big endian order

Auto Trait Implementations§

§

impl<'a> Freeze for DecoderV2<'a>

§

impl<'a> RefUnwindSafe for DecoderV2<'a>

§

impl<'a> Send for DecoderV2<'a>

§

impl<'a> Sync for DecoderV2<'a>

§

impl<'a> Unpin for DecoderV2<'a>

§

impl<'a> UnwindSafe for DecoderV2<'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
§

impl<T> CompatExt for T

§

fn compat(self) -> Compat<T>

Applies the [Compat] adapter by value. Read more
§

fn compat_ref(&self) -> Compat<&T>

Applies the [Compat] adapter by shared reference. Read more
§

fn compat_mut(&mut self) -> Compat<&mut T>

Applies the [Compat] adapter by mutable reference. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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>,

Source§

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more