pub struct Codec { /* private fields */ }Expand description
An alphabet and a padding rule
Implementations§
Source§impl Codec
impl Codec
Sourcepub const fn encoded_len(&self, len: usize) -> Option<usize>
pub const fn encoded_len(&self, len: usize) -> Option<usize>
Characters the encoding of len bytes takes, None if it overflows
Sourcepub const fn decoded_len_max(&self, len: usize) -> usize
pub const fn decoded_len_max(&self, len: usize) -> usize
The most bytes the decoding of len characters can take
Sourcepub fn decoded_len(&self, input: &[u8]) -> Result<usize, DecodeError>
pub fn decoded_len(&self, input: &[u8]) -> Result<usize, DecodeError>
Bytes input decodes to, from its length and padding without reading it
Trait Implementations§
impl Copy for Codec
impl Eq for Codec
impl StructuralPartialEq for Codec
Auto Trait Implementations§
impl Freeze for Codec
impl RefUnwindSafe for Codec
impl Send for Codec
impl Sync for Codec
impl Unpin for Codec
impl UnsafeUnpin for Codec
impl UnwindSafe for Codec
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