Trait bincode::de::Decode [−][src]
pub trait Decode: for<'de> BorrowDecode<'de> {
fn decode<D: Decoder>(decoder: D) -> Result<Self, DecodeError>;
}Expand description
Trait that makes a type able to be decoded, akin to serde’s DeserializeOwned trait.
This trait should be implemented for types which do not have references to data in the reader. For types that contain e.g. &str and &[u8], implement BorrowDecode instead.
Whenever you implement Decode for your type, the base trait BorrowDecode is automatically implemented.
This trait will be automatically implemented if you enable the derive feature and add #[derive(bincode::Decode)] to your type. Note that if the type contains any lifetimes, BorrowDecode will be implemented instead.
Required methods
Implementations on Foreign Types
Implementors
impl<T> Decode for Compat<T> where
T: DeserializeOwned,
This is supported on crate feature
serde only.