pub struct Base64 {}
Expand description
Base64 Encoding
(traditional non-URL-safe RFC 4648 version)
Character set: [A-Z]
, [a-z]
, [0-9]
, +
, /
Trait Implementations§
Source§impl Encoding for Base64
impl Encoding for Base64
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 Base64
impl Ord for Base64
Source§impl PartialOrd for Base64
impl PartialOrd for Base64
impl Copy for Base64
impl Eq for Base64
impl StructuralPartialEq for Base64
Auto Trait Implementations§
impl Freeze for Base64
impl RefUnwindSafe for Base64
impl Send for Base64
impl Sync for Base64
impl Unpin for Base64
impl UnwindSafe for Base64
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