Struct aliri_base64::Base64Ref
source · pub struct Base64Ref(/* private fields */);
Expand description
Borrowed data to be encoded as standard base64
Encoding alphabet: A
–Z
, a
–z
, 0
–9
, +
, /
Padding character: =
Data is borrowed in its raw form. Costs of converting to base64 form are only incurred when serializing or displaying the value.
Implementations§
source§impl Base64Ref
impl Base64Ref
sourcepub fn from_slice(raw: &[u8]) -> &Self
pub fn from_slice(raw: &[u8]) -> &Self
Transparently reinterprets the slice as base64
sourcepub fn from_mut_slice(raw: &mut [u8]) -> &mut Self
pub fn from_mut_slice(raw: &mut [u8]) -> &mut Self
Transparently reinterprets the mutable slice as base64
sourcepub const fn encoded_len(&self) -> usize
pub const fn encoded_len(&self) -> usize
Calculates the expected length of the base64-encoding of this buffer
sourcepub fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
pub fn as_mut_slice(&mut self) -> &mut [u8] ⓘ
Provides mutable access to the underlying slice
Trait Implementations§
source§impl PartialEq<Base64> for Base64Ref
impl PartialEq<Base64> for Base64Ref
source§impl PartialEq<Base64Ref> for Base64
impl PartialEq<Base64Ref> for Base64
source§impl PartialEq for Base64Ref
impl PartialEq for Base64Ref
source§impl Serialize for Base64Ref
Available on crate feature serde
only.
impl Serialize for Base64Ref
Available on crate feature
serde
only.Serialize the underlying byte array as a base64 string