Struct ct_codecs::Base64

source ·
pub struct Base64;

Trait Implementations§

source§

impl Decoder for Base64

source§

fn decode<'t, IN: AsRef<[u8]>>( bin: &'t mut [u8], b64: IN, ignore: Option<&[u8]>, ) -> Result<&'t [u8], Error>

Decode encoded into bin. The output buffer can be larger than required; the returned slice is a view of the buffer with the correct length. ignore is an optional set of characters to ignore.
source§

fn decode_to_vec<IN: AsRef<[u8]>>( encoded: IN, ignore: Option<&[u8]>, ) -> Result<Vec<u8>, Error>

Decode encoded into a Vec<u8>. ignore is an optional set of characters to ignore.
source§

impl Encoder for Base64

source§

fn encoded_len(bin_len: usize) -> Result<usize, Error>

Length of bin_len bytes after encoding.
source§

fn encode<IN: AsRef<[u8]>>(b64: &mut [u8], bin: IN) -> Result<&[u8], Error>

Encode bin into encoded. The output buffer can be larger than required; the returned slice is a view of the buffer with the correct length.
source§

fn encode_to_str<IN: AsRef<[u8]>>( encoded: &mut [u8], bin: IN, ) -> Result<&str, Error>

Encode bin into encoded, return the result as a str. The output buffer can be larger than required; the returned slice is a view of the buffer with the correct length.
source§

fn encode_to_string<IN: AsRef<[u8]>>(bin: IN) -> Result<String, Error>

Encode bin as a String.

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.