pub struct ConstHexForm<T>(/* private fields */);
Expand description
A dummy container for use inside #[serde(with)]
attribute if the underlying type
implements ConstHex
.
Trait Implementations§
Source§impl<const N: usize> ConstHex<[u8; N], N> for ConstHexForm<[u8; N]>
impl<const N: usize> ConstHex<[u8; N], N> for ConstHexForm<[u8; N]>
Source§type Error = TryFromSliceError
type Error = TryFromSliceError
Available on crate feature
const_len
only.Error returned on unsuccessful deserialization.
Source§fn create_bytes(buffer: &[u8; N]) -> [u8; N]
fn create_bytes(buffer: &[u8; N]) -> [u8; N]
Available on crate feature
const_len
only.Converts the value into bytes. This is used for serialization.
Source§fn from_bytes(bytes: [u8; N]) -> Result<[u8; N], Self::Error>
fn from_bytes(bytes: [u8; N]) -> Result<[u8; N], Self::Error>
Available on crate feature
const_len
only.Creates a value from the byte slice. Read more
Source§fn serialize<S: Serializer>(value: &T, serializer: S) -> Result<S::Ok, S::Error>
fn serialize<S: Serializer>(value: &T, serializer: S) -> Result<S::Ok, S::Error>
Available on crate feature
const_len
only.Serializes the value for
serde
. This method is not meant to be overridden. Read moreSource§fn deserialize<'de, D>(deserializer: D) -> Result<T, D::Error>where
D: Deserializer<'de>,
fn deserialize<'de, D>(deserializer: D) -> Result<T, D::Error>where
D: Deserializer<'de>,
Available on crate feature
const_len
only.Deserializes a value using
serde
. This method is not meant to be overridden. Read moreAuto Trait Implementations§
impl<T> Freeze for ConstHexForm<T>
impl<T> RefUnwindSafe for ConstHexForm<T>where
T: RefUnwindSafe,
impl<T> Send for ConstHexForm<T>where
T: Send,
impl<T> Sync for ConstHexForm<T>where
T: Sync,
impl<T> Unpin for ConstHexForm<T>where
T: Unpin,
impl<T> UnwindSafe for ConstHexForm<T>where
T: 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