pub struct CompactSizeEncoder { /* private fields */ }Expand description
Encoder for a compact size encoded integer.
Implementations§
Source§impl CompactSizeEncoder
impl CompactSizeEncoder
Sourcepub fn new(value: usize) -> Self
pub fn new(value: usize) -> Self
Constructs a new CompactSizeEncoder.
Encodings are defined only for the range of u64. On systems where usize is
larger than u64, it will be possible to call this method with out-of-range
values. In such cases we will ignore the passed value and encode u64::MAX.
But even on such exotic systems, we expect users to pass the length of an
in-memory object, meaning that such large values are impossible to obtain.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CompactSizeEncoder
impl RefUnwindSafe for CompactSizeEncoder
impl Send for CompactSizeEncoder
impl Sync for CompactSizeEncoder
impl Unpin for CompactSizeEncoder
impl UnwindSafe for CompactSizeEncoder
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