pub struct Base64 { /* private fields */ }
Expand description

Implementations

Standard charset with padding.

Standard charset without padding.

URL-safe charset with padding.

URL-safe charset without padding.

Returns the character set used for encoding.

Calculates the encoded length.

Panics

This function panics if any of the conditions below is not satisfied:

  • n <= isize::MAX

Estimates the decoded length.

The result is an upper bound which can be used for allocation.

Calculates the decoded length.

The result is a precise value which can be used for allocation.

Encodes src and writes to dst.

Errors

This function returns Err if:

  • The length of dst is not enough.

Encodes src to dst and returns &mut str.

Errors

This function returns Err if:

  • The length of dst is not enough.

Decodes src and writes to dst.

Errors

This function returns Err if:

  • The length of dst is not enough.
  • The content of src is invalid.

Decodes data and writes inplace.

Errors

This function returns Err if:

  • The content of data is invalid.
Available on crate feature alloc only.

Encodes data and returns Box<str>

Panics

This function panics if:

  • The encoded length of data is greater than isize::MAX
Available on crate feature alloc only.

Decodes data and returns Box<[u8]>

Errors

This function returns Err if:

  • The content of data is invalid.

Forgiving decodes data and writes inplace.

See https://infra.spec.whatwg.org/#forgiving-base64

Trait Implementations

Formats the value using the given formatter. Read more

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

Returns the argument unchanged.

Calls U::from(self).

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

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.