pub struct VInt64 {
pub value: u64,
pub is_unknown: bool,
}Expand description
A variable-length integer RFC 8794
Fields§
§value: u64The decoded integer value.
is_unknown: boolWhether this VInt64 represents an unknown size.
Implementations§
Source§impl VInt64
impl VInt64
Sourcepub const fn from_encoded(enc: u64) -> Self
pub const fn from_encoded(enc: u64) -> Self
Create a VInt64 from an already encoded u64 value.
Sourcepub const fn new_unknown() -> Self
pub const fn new_unknown() -> Self
Create a VInt64 representing an unknown size.
Sourcepub fn as_encoded(&self) -> u64
pub fn as_encoded(&self) -> u64
Create a VInt64 from an already encoded u64 value.
Sourcepub const fn encode_size(value: u64) -> usize
pub const fn encode_size(value: u64) -> usize
Get the size in bytes of the encoded representation of a u64 value.
Trait Implementations§
Source§impl AsyncReadFrom for VInt64
Available on crate feature tokio only.
impl AsyncReadFrom for VInt64
Available on crate feature
tokio only.Source§impl Ord for VInt64
impl Ord for VInt64
Source§impl PartialOrd for VInt64
impl PartialOrd for VInt64
impl Copy for VInt64
impl Eq for VInt64
impl StructuralPartialEq for VInt64
Auto Trait Implementations§
impl Freeze for VInt64
impl RefUnwindSafe for VInt64
impl Send for VInt64
impl Sync for VInt64
impl Unpin for VInt64
impl UnwindSafe for VInt64
Blanket Implementations§
Source§impl<T> AsyncWriteTo for Twhere
T: Encode,
impl<T> AsyncWriteTo for Twhere
T: Encode,
Source§async fn async_write_to<W>(&self, w: &mut W) -> Result<(), Error>where
W: AsyncWrite + Unpin,
async fn async_write_to<W>(&self, w: &mut W) -> Result<(), Error>where
W: AsyncWrite + Unpin,
Available on crate feature
tokio only.Write to a writer asynchronously.
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