pub struct BorrowCompat<T>(pub T);
Available on crate feature serde only.
Expand description

Wrapper struct that implements BorrowDecode and Encode on any type that implements serde’s Deserialize and Serialize respectively. This is mostly used on &[u8] and &str, for other types consider using Compat instead.

Tuple Fields

0: T

Trait Implementations

Attempt to decode this type with the given BorrowDecode.
Encode a given type.

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.