pub struct HexOrBin<const UPPERCASE: bool>(pub Vec<u8>);
Expand description
Serializer/deserializer newtype which encodes bytes as either binary or hex.
Use hexadecimal with human-readable formats, or raw binary with binary formats.
Tuple Fields§
§0: Vec<u8>
Trait Implementations§
source§impl<'de, const UPPERCASE: bool> Deserialize<'de> for HexOrBin<UPPERCASE>
impl<'de, const UPPERCASE: bool> Deserialize<'de> for HexOrBin<UPPERCASE>
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<const UPPERCASE: bool> Ord for HexOrBin<UPPERCASE>
impl<const UPPERCASE: bool> Ord for HexOrBin<UPPERCASE>
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<const UPPERCASE: bool> PartialEq for HexOrBin<UPPERCASE>
impl<const UPPERCASE: bool> PartialEq for HexOrBin<UPPERCASE>
source§impl<const UPPERCASE: bool> PartialOrd for HexOrBin<UPPERCASE>
impl<const UPPERCASE: bool> PartialOrd for HexOrBin<UPPERCASE>
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 moreimpl<const UPPERCASE: bool> Eq for HexOrBin<UPPERCASE>
impl<const UPPERCASE: bool> StructuralPartialEq for HexOrBin<UPPERCASE>
Auto Trait Implementations§
impl<const UPPERCASE: bool> Freeze for HexOrBin<UPPERCASE>
impl<const UPPERCASE: bool> RefUnwindSafe for HexOrBin<UPPERCASE>
impl<const UPPERCASE: bool> Send for HexOrBin<UPPERCASE>
impl<const UPPERCASE: bool> Sync for HexOrBin<UPPERCASE>
impl<const UPPERCASE: bool> Unpin for HexOrBin<UPPERCASE>
impl<const UPPERCASE: bool> UnwindSafe for HexOrBin<UPPERCASE>
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)