logo
pub struct Encoder<'o, E: Variant> { /* private fields */ }
Expand description

Stateful Base64 encoder with support for buffered, incremental encoding.

The E type parameter can be any type which impls Encoding such as [Base64] or [Base64Unpadded].

Internally it uses a sealed Variant trait which is an implementation detail of this crate, and leverages a blanket impl of Encoding.

Implementations

Create a new decoder for a byte slice containing contiguous (non-newline-delimited) Base64-encoded data.

Encode the provided buffer as Base64, writing it to the output buffer.

Returns
  • Ok(bytes) if the expected amount of data was read
  • Err(Error::InvalidLength) if there is insufficient space in the output buffer

Finish encoding data, returning the resulting Base64 as a str.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.