[−][src]Struct hex_buffer_serde::HexForm
A dummy container for use inside #[serde(with)]
attribute.
Why a separate container?
We need a separate type (instead of just using impl<T> Hex<T> for T
)
both for code clarity and because otherwise invocations within generated serde
code
would be ambiguous for types implementing Serialize
/ Deserialize
.
Trait Implementations
impl<T> Hex<T> for HexForm<T> where
T: AsRef<[u8]> + for<'a> TryFrom<&'a [u8]>,
<T as TryFrom<&'a [u8]>>::Error: ToString,
[src]
T: AsRef<[u8]> + for<'a> TryFrom<&'a [u8]>,
<T as TryFrom<&'a [u8]>>::Error: ToString,
fn create_bytes(buffer: &T) -> Cow<[u8]>
[src]
fn from_bytes(bytes: &[u8]) -> Result<T, String>
[src]
fn serialize<S: Serializer>(value: &T, serializer: S) -> Result<S::Ok, S::Error>
[src]
Serializes the value for serde
. This method is not meant to be overridden. Read more
fn deserialize<'de, D>(deserializer: D) -> Result<T, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
Deserializes a value using serde
. This method is not meant to be overridden. Read more
impl<T: Debug> Debug for HexForm<T>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,