Struct B64
#[repr(transparent)]pub struct B64<N>(pub N);
Expand description
newtype around bytes to print/parse b64 (url-safe no-padding)
Tuple Fields§
§0: N
Implementations§
§impl<const N: usize> B64<[u8; N]>
impl<const N: usize> B64<[u8; N]>
pub fn into_bytes(self) -> [u8; N]
pub fn from_ref(b: &[u8; N]) -> &B64<[u8; N]>
pub fn slice_into_bytes(slice: &[B64<[u8; N]>]) -> &[u8] ⓘ
pub fn slice_from_bytes( slice: &[u8], ) -> Result<&[B64<[u8; N]>], (&[B64<[u8; N]>], &[u8])>
pub fn try_from_exact(slice: &[u8]) -> Result<B64<[u8; N]>, MatchErrorKind>
pub fn new(b: [u8; N]) -> B64<[u8; N]>
Trait Implementations§
§impl<'de, const N: usize> Deserialize<'de> for B64<[u8; N]>
impl<'de, const N: usize> Deserialize<'de> for B64<[u8; N]>
§fn deserialize<D>(
deserializer: D,
) -> Result<B64<[u8; N]>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<B64<[u8; N]>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl<'de> Deserialize<'de> for B64<Vec<u8>>
impl<'de> Deserialize<'de> for B64<Vec<u8>>
§fn deserialize<D>(
deserializer: D,
) -> Result<B64<Vec<u8>>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<B64<Vec<u8>>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl<N> Ord for B64<N>where
N: Ord,
impl<N> Ord for B64<N>where
N: Ord,
§impl<N> PartialOrd for B64<N>where
N: PartialOrd,
impl<N> PartialOrd for B64<N>where
N: PartialOrd,
§impl<B> Serialize for B64<B>
impl<B> Serialize for B64<B>
§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
§impl UInt for B64<[u8; 32]>
impl UInt for B64<[u8; 32]>
const MIN: B64<[u8; 32]>
const MAX: B64<[u8; 32]>
const ONE: B64<[u8; 32]>
const BITS: u32 = 256u32
const BYTE_SIZE: usize = 32usize
fn bit_and(self, other: B64<[u8; 32]>) -> B64<[u8; 32]>
fn bit_or(self, other: B64<[u8; 32]>) -> B64<[u8; 32]>
fn not(self) -> B64<[u8; 32]>
fn inc(self) -> Option<B64<[u8; 32]>>
fn decr(self) -> Option<B64<[u8; 32]>>
fn checked_sub(self, other: B64<[u8; 32]>) -> Option<B64<[u8; 32]>>
fn checked_add(self, other: B64<[u8; 32]>) -> Option<B64<[u8; 32]>>
fn overflowing_shl(self, rhs: u32) -> (B64<[u8; 32]>, bool)
fn overflowing_shr(self, rhs: u32) -> (B64<[u8; 32]>, bool)
fn leading_zeros(&self) -> u32
fn trailing_zeros(&self) -> u32
fn trailing_ones(&self) -> u32
fn leading_ones(&self) -> u32
fn overflowing_add(self, rhs: B64<[u8; 32]>) -> (B64<[u8; 32]>, bool)
fn as_be_bytes(&self, out: &mut dyn FnMut(&[u8]))
fn to_be_vec(&self) -> Vec<u8> ⓘ
impl<N> Copy for B64<N>where
N: Copy,
impl<N> Eq for B64<N>where
N: Eq,
impl<N> StructuralPartialEq for B64<N>
Auto Trait Implementations§
impl<N> Freeze for B64<N>where
N: Freeze,
impl<N> RefUnwindSafe for B64<N>where
N: RefUnwindSafe,
impl<N> Send for B64<N>where
N: Send,
impl<N> Sync for B64<N>where
N: Sync,
impl<N> Unpin for B64<N>where
N: Unpin,
impl<N> UnwindSafe for B64<N>where
N: 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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more