#[repr(transparent)]pub struct B64<N = [u8; 32]>(pub N);
Expand description
newtype around bytes to print/parse b64 (url-safe no-padding)
Tuple Fields§
§0: N
Implementations§
Trait Implementations§
§impl<'de, N> Deserialize<'de> for B64<N>where
N: Deserialize<'de>,
impl<'de, N> Deserialize<'de> for B64<N>where N: Deserialize<'de>,
§fn deserialize<__D>(
__deserializer: __D
) -> Result<B64<N>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<B64<N>, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl From<B64> for NetPktHeader
impl From<B64> for NetPktHeader
§fn from(v: B64) -> NetPktHeader
fn from(v: B64) -> NetPktHeader
Converts to this type from the input type.
§impl From<NetPktHeader> for B64
impl From<NetPktHeader> for B64
§fn from(val: NetPktHeader) -> B64
fn from(val: NetPktHeader) -> B64
Converts to this type from the input type.
§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,
§fn partial_cmp(&self, other: &B64<N>) -> Option<Ordering>
fn partial_cmp(&self, other: &B64<N>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more§impl<N> Serialize for B64<N>where
N: Serialize,
impl<N> Serialize for B64<N>where N: Serialize,
§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
impl UInt for B64
const MIN: B64 = _
const MAX: B64 = _
const ONE: B64 = _
const BITS: u32 = 256u32
fn bit_and(self, other: B64) -> B64
fn bit_or(self, other: B64) -> B64
fn not(self) -> B64
fn inc(self) -> Option<B64>
fn decr(self) -> Option<B64>
fn checked_sub(self, other: B64) -> Option<B64>
fn checked_add(self, other: B64) -> Option<B64>
fn overflowing_shl(self, rhs: u32) -> (B64, bool)
fn overflowing_shr(self, rhs: u32) -> (B64, 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) -> (B64, 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> Pod for B64<N>where N: Pod,
impl<N> StructuralEq for B64<N>
impl<N> StructuralPartialEq for B64<N>
Auto Trait Implementations§
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
§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere T: AnyBitPattern,
§type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.