pub struct KeyDeserializer<'a> {
pub data: &'a [u8],
/* private fields */
}Expand description
Handles decoding of sequential serialized key payloads.
Fields§
§data: &'a [u8]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 serialized key with a 2-byte length prefix from the front of payload data.
Sourcepub fn new_without_prefix(data: &'a [u8]) -> Self
pub fn new_without_prefix(data: &'a [u8]) -> Self
Constructs deserializer without expecting standard 2-byte size prefix.
Sourcepub fn read_u64(&mut self) -> Result<u64, Error>
pub fn read_u64(&mut self) -> Result<u64, Error>
Reads a u64. If a base was provided and this is the first u64, it applies the base.
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