pub struct Base64<C = Standard, B = Vec<u8>> { /* private fields */ }
Expand description
A wrapper around B
(usually Vec<u8>
) that (de)serializes from / to a base64 string.
The base64 character set (and miscellaneous other encoding / decoding options) can be customized
through the generic parameter C
.
Implementations§
Source§impl<C, B> Base64<C, B>
impl<C, B> Base64<C, B>
Sourcepub fn new(bytes: B) -> Base64<C, B>
Available on crate feature events
only.
pub fn new(bytes: B) -> Base64<C, B>
events
only.Create a Base64
instance from raw bytes, to be base64-encoded in serialization.
Source§impl<C, B> Base64<C, B>
impl<C, B> Base64<C, B>
Sourcepub fn into_inner(self) -> B
Available on crate feature events
only.
pub fn into_inner(self) -> B
events
only.Get the raw bytes held by this Base64
instance.
Trait Implementations§
Source§impl<'de, C> Deserialize<'de> for Base64<C>where
C: Base64Config,
impl<'de, C> Deserialize<'de> for Base64<C>where
C: Base64Config,
Source§fn deserialize<D>(
deserializer: D,
) -> Result<Base64<C>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Base64<C>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<C, B> Ord for Base64<C, B>
impl<C, B> Ord for Base64<C, B>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<C, B> PartialOrd for Base64<C, B>where
C: PartialOrd,
B: PartialOrd,
impl<C, B> PartialOrd for Base64<C, B>where
C: PartialOrd,
B: PartialOrd,
Source§impl<C, B> Serialize for Base64<C, B>
impl<C, B> Serialize for Base64<C, B>
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl TryFrom<&Base64PublicKey> for Base64
impl TryFrom<&Base64PublicKey> for Base64
Source§type Error = Base64DecodeError
type Error = Base64DecodeError
The type returned in the event of a conversion error.
Source§fn try_from(
value: &Base64PublicKey,
) -> Result<Base64, <Base64 as TryFrom<&Base64PublicKey>>::Error>
fn try_from( value: &Base64PublicKey, ) -> Result<Base64, <Base64 as TryFrom<&Base64PublicKey>>::Error>
Performs the conversion.
Source§impl TryFrom<&OwnedBase64PublicKey> for Base64
impl TryFrom<&OwnedBase64PublicKey> for Base64
Source§type Error = Base64DecodeError
type Error = Base64DecodeError
The type returned in the event of a conversion error.
Source§fn try_from(
value: &OwnedBase64PublicKey,
) -> Result<Base64, <Base64 as TryFrom<&OwnedBase64PublicKey>>::Error>
fn try_from( value: &OwnedBase64PublicKey, ) -> Result<Base64, <Base64 as TryFrom<&OwnedBase64PublicKey>>::Error>
Performs the conversion.
Source§impl TryFrom<OwnedBase64PublicKey> for Base64
impl TryFrom<OwnedBase64PublicKey> for Base64
Source§type Error = Base64DecodeError
type Error = Base64DecodeError
The type returned in the event of a conversion error.
Source§fn try_from(
value: OwnedBase64PublicKey,
) -> Result<Base64, <Base64 as TryFrom<OwnedBase64PublicKey>>::Error>
fn try_from( value: OwnedBase64PublicKey, ) -> Result<Base64, <Base64 as TryFrom<OwnedBase64PublicKey>>::Error>
Performs the conversion.
impl<C, B> Eq for Base64<C, B>
impl<C, B> StructuralPartialEq for Base64<C, B>
Auto Trait Implementations§
impl<C, B> Freeze for Base64<C, B>where
B: Freeze,
impl<C, B> RefUnwindSafe for Base64<C, B>where
B: RefUnwindSafe,
impl<C, B> Send for Base64<C, B>where
B: Send,
impl<C, B> Sync for Base64<C, B>where
B: Sync,
impl<C, B> Unpin for Base64<C, B>where
B: Unpin,
impl<C, B> UnwindSafe for Base64<C, B>where
B: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.