pub struct Identity {}
Expand description
Encoding
which does not transform data and returns the original input.
Trait Implementations§
Source§impl Encoding for Identity
impl Encoding for Identity
Source§fn encode_to_slice(&self, src: &[u8], dst: &mut [u8]) -> Result<usize, Error>
fn encode_to_slice(&self, src: &[u8], dst: &mut [u8]) -> Result<usize, Error>
Encode the given slice into the destination buffer. Read more
Source§fn encoded_len(&self, bytes: &[u8]) -> usize
fn encoded_len(&self, bytes: &[u8]) -> usize
Calculate the length of the given data after encoding.
Source§fn decode_to_slice(&self, src: &[u8], dst: &mut [u8]) -> Result<usize, Error>
fn decode_to_slice(&self, src: &[u8], dst: &mut [u8]) -> Result<usize, Error>
Decode hexadecimal (upper or lower case) with branchless / secret-independent logic
Source§fn decoded_len(&self, bytes: &[u8]) -> Result<usize, Error>
fn decoded_len(&self, bytes: &[u8]) -> Result<usize, Error>
Calculate the length of the given data after decoding.
Source§fn encode<B: AsRef<[u8]>>(&self, bytes: B) -> Vec<u8> ⓘ
fn encode<B: AsRef<[u8]>>(&self, bytes: B) -> Vec<u8> ⓘ
Encode the given buffer, returning a
Vec<u8>
Source§fn encode_to_writer<B, W>(
&self,
bytes: B,
writer: &mut W,
) -> Result<usize, Error>
fn encode_to_writer<B, W>( &self, bytes: B, writer: &mut W, ) -> Result<usize, Error>
Encode the given slice with this
Encoding
, writing the result to the
supplied io::Write
type, returning the number of bytes written or a Error
.Source§fn encode_to_file<B, P>(&self, bytes: B, path: P) -> Result<File, Error>
fn encode_to_file<B, P>(&self, bytes: B, path: P) -> Result<File, Error>
Encode
self
and write it to a file at the given path, returning the
resulting File
or a Error
. Read moreSource§fn decode<B: AsRef<[u8]>>(&self, encoded_bytes: B) -> Result<Vec<u8>, Error>
fn decode<B: AsRef<[u8]>>(&self, encoded_bytes: B) -> Result<Vec<u8>, Error>
Decode the given buffer, returning a
Vec<u8>
Source§fn decode_from_str<S: AsRef<str>>(&self, encoded: S) -> Result<Vec<u8>, Error>
fn decode_from_str<S: AsRef<str>>(&self, encoded: S) -> Result<Vec<u8>, Error>
Decode the given string-alike type with this
Encoding
, returning the
decoded value or a Error
.Source§impl Ord for Identity
impl Ord for Identity
Source§impl PartialOrd for Identity
impl PartialOrd for Identity
impl Copy for Identity
impl Eq for Identity
impl StructuralPartialEq for Identity
Auto Trait Implementations§
impl Freeze for Identity
impl RefUnwindSafe for Identity
impl Send for Identity
impl Sync for Identity
impl Unpin for Identity
impl UnwindSafe for Identity
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