pub struct HexForm<T>(_);
Available on crate feature alloc only.
Expand description

A dummy container for use inside #[serde(with)] attribute if the underlying type implements Hex.

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

Formats the value using the given formatter. Read more
Available on crate feature alloc only.
Error returned on unsuccessful deserialization.
Available on crate feature alloc only.
Converts the value into bytes. This is used for serialization. Read more
Available on crate feature alloc only.
Creates a value from the byte slice. Read more
Available on crate feature alloc only.
Serializes the value for serde. This method is not meant to be overridden. Read more
Available on crate feature alloc only.
Deserializes a value using serde. This method is not meant to be overridden. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.