pub trait BorrowDecode<'de>: Sized {
    fn borrow_decode<D: BorrowDecoder<'de>>(
        decoder: &mut D
    ) -> Result<Self, DecodeError>; }
Expand description

Trait that makes a type able to be decoded, akin to serde’s Deserialize trait.

This trait should be implemented for types that contain borrowed data, like &str and &[u8]. If your type does not have borrowed data, consider implementing Decode instead.

This trait will be automatically implemented if you enable the derive feature and add #[derive(bincode::Decode)] to a type with a lifetime.

Required methods

Attempt to decode this type with the given BorrowDecode.

Implementations on Foreign Types

Implementors