pub struct KeyDeserializer<'a> { /* private fields */ }Expand description
Handles decoding of sequential serialized key payloads.
Implementations§
Source§impl<'a> KeyDeserializer<'a>
impl<'a> KeyDeserializer<'a>
Sourcepub fn new(data: &'a [u8], base: Option<u64>) -> Result<(Self, usize), Error>
pub fn new(data: &'a [u8], base: Option<u64>) -> Result<(Self, usize), Error>
Parses a serialized chunked key from the front of data.
Returns the deserializer positioned at the key payload, along with the total
bytes consumed in data (headers + payload chunks).
Sourcepub fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
pub fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
Reads exactly buf.len() bytes into buf. Non-terminal fields are assumed to fit within
the initial chunk.
Sourcepub fn read_u64(&mut self) -> Result<u64, Error>
pub fn read_u64(&mut self) -> Result<u64, Error>
Reads a 64-bit unsigned integer. If a base was provided and this is the first item, adds the base to reconstruct the original value.
Sourcepub fn read_varint(&mut self) -> Result<u64, Error>
pub fn read_varint(&mut self) -> Result<u64, Error>
Extracts an order-preserving decoded 64-bit variable length integer from stream.
Auto Trait Implementations§
impl<'a> Freeze for KeyDeserializer<'a>
impl<'a> RefUnwindSafe for KeyDeserializer<'a>
impl<'a> Send for KeyDeserializer<'a>
impl<'a> Sync for KeyDeserializer<'a>
impl<'a> Unpin for KeyDeserializer<'a>
impl<'a> UnsafeUnpin for KeyDeserializer<'a>
impl<'a> UnwindSafe for KeyDeserializer<'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, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<F, N> FidlIntoNative<Box<N>> for Fwhere
F: FidlIntoNative<N>,
impl<F, N> FidlIntoNative<Box<N>> for Fwhere
F: FidlIntoNative<N>,
fn fidl_into_native(self) -> Box<N>
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