pub struct ValidatedAlphabet { /* private fields */ }Expand description
An owned, immutable, validated 64-byte Base64 alphabet.
Encode and decode mappings are both derived from table. The type has no
executable callback or overridable mapping method.
Implementations§
Source§impl ValidatedAlphabet
impl ValidatedAlphabet
Sourcepub const fn new(table: [u8; 64]) -> Result<Self, ValidatedAlphabetError>
pub const fn new(table: [u8; 64]) -> Result<Self, ValidatedAlphabetError>
Validates and owns a 64-byte alphabet.
Sourcepub const fn try_from_slice(
bytes: &[u8],
) -> Result<Self, ValidatedAlphabetError>
pub const fn try_from_slice( bytes: &[u8], ) -> Result<Self, ValidatedAlphabetError>
Copies, validates, and owns a 64-byte alphabet slice.
Sourcepub const fn encode_value(&self, value: u8) -> Option<u8>
pub const fn encode_value(&self, value: u8) -> Option<u8>
Returns the encoded symbol for one six-bit value.
Sourcepub const fn decode_byte(&self, byte: u8) -> Option<u8>
pub const fn decode_byte(&self, byte: u8) -> Option<u8>
Returns the six-bit value represented by byte.
Trait Implementations§
Source§impl Clone for ValidatedAlphabet
impl Clone for ValidatedAlphabet
Source§fn clone(&self) -> ValidatedAlphabet
fn clone(&self) -> ValidatedAlphabet
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ValidatedAlphabet
Source§impl Debug for ValidatedAlphabet
impl Debug for ValidatedAlphabet
impl Eq for ValidatedAlphabet
Source§impl Hash for ValidatedAlphabet
impl Hash for ValidatedAlphabet
Source§impl PartialEq for ValidatedAlphabet
impl PartialEq for ValidatedAlphabet
impl StructuralPartialEq for ValidatedAlphabet
Source§impl TryFrom<&[u8]> for ValidatedAlphabet
impl TryFrom<&[u8]> for ValidatedAlphabet
Auto Trait Implementations§
impl Freeze for ValidatedAlphabet
impl RefUnwindSafe for ValidatedAlphabet
impl Send for ValidatedAlphabet
impl Sync for ValidatedAlphabet
impl Unpin for ValidatedAlphabet
impl UnsafeUnpin for ValidatedAlphabet
impl UnwindSafe for ValidatedAlphabet
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