pub struct MultiEncoded(/* private fields */);Expand description
Multi-encoded byte slice.
Implementations§
Source§impl MultiEncoded
impl MultiEncoded
Sourcepub fn new(bytes: &[u8]) -> Result<&Self, Error>
pub fn new(bytes: &[u8]) -> Result<&Self, Error>
Creates a new multi-encoded slice from the given bytes.
Following the [unsigned-varint] specification and to avoid memory
attacks, the coded must be encoded on at most 9 bytes (63 bits unsigned
varint).
Sourcepub unsafe fn new_unchecked(bytes: &[u8]) -> &Self
pub unsafe fn new_unchecked(bytes: &[u8]) -> &Self
Creates a new multi-encoded slice from the given bytes without
checking the codec.
§Safety
Following the [unsigned-varint] specification and to avoid memory
attacks, the coded must be encoded on at most 9 bytes (63 bits unsigned
varint).