pub trait VarInt: Debug + Copy {
// Required methods
fn zero() -> Self;
fn as_varint(&self) -> Vec<u8>;
fn write_varint(&self, buf: &mut Vec<u8>);
fn from_varint(buf: &[u8]) -> Result<(Self, &[u8]), VartyIntError>
where Self: Sized;
// Provided method
fn read_varint(buf: &[u8]) -> Result<(Self, &[u8]), VartyIntError>
where Self: Sized { ... }
}
Required Methods§
fn zero() -> Self
fn as_varint(&self) -> Vec<u8>
fn write_varint(&self, buf: &mut Vec<u8>)
fn from_varint(buf: &[u8]) -> Result<(Self, &[u8]), VartyIntError>where
Self: Sized,
Provided Methods§
fn read_varint(buf: &[u8]) -> Result<(Self, &[u8]), VartyIntError>where
Self: Sized,
Object Safety§
This trait is not object safe.