Struct hex_buffer_serde::ConstHexForm
source · pub struct ConstHexForm<T>(_);
Available on crate feature
const_len
only.Expand description
A dummy container for use inside #[serde(with)]
attribute if the underlying type
implements ConstHex
.
Trait Implementations
sourceimpl<const N: usize> ConstHex<[u8; N], N> for ConstHexForm<[u8; N]>
impl<const N: usize> ConstHex<[u8; N], N> for ConstHexForm<[u8; N]>
type Error = TryFromSliceError
type Error = TryFromSliceError
Available on crate feature
const_len
only.Error returned on unsuccessful deserialization.
sourcefn 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.
sourcefn 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
sourcefn 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 moresourcefn 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> 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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more