Struct base64::alphabet::Alphabet [−][src]
pub struct Alphabet { /* fields omitted */ }
Expand description
An alphabet defines the 64 ASCII characters (symbols) used for base64.
Common alphabets are provided as constants, and custom alphabets
can be made via from_str
or the TryFrom<str>
implementation.
let custom = base64::alphabet::Alphabet::from_str("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/").unwrap();
let engine = base64::engine::fast_portable::FastPortable::from(
&custom,
base64::engine::fast_portable::PAD);
Implementations
Create an Alphabet
from a string of 64 unique printable ASCII bytes.
The =
byte is not allowed as it is used for padding.
The const
-ness of this function isn’t useful as of rust 1.54.0 since const
unwrap()
,
etc, haven’t shipped yet, but that’s on the roadmap.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Alphabet
impl UnwindSafe for Alphabet
Blanket Implementations
Mutably borrows from an owned value. Read more