borsh::de

Trait BorshDeserialize

Source
pub trait BorshDeserialize: Sized {
    // Required method
    fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>;

    // Provided methods
    fn deserialize(buf: &mut &[u8]) -> Result<Self> { ... }
    fn try_from_slice(v: &[u8]) -> Result<Self> { ... }
    fn try_from_reader<R: Read>(reader: &mut R) -> Result<Self> { ... }
}
Expand description

A data-structure that can be de-serialized from binary format by NBOR.

Required Methods§

Source

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Provided Methods§

Source

fn deserialize(buf: &mut &[u8]) -> Result<Self>

Deserializes this instance from a given slice of bytes. Updates the buffer to point at the remaining bytes.

Source

fn try_from_slice(v: &[u8]) -> Result<Self>

Deserialize this instance from a slice of bytes.

Source

fn try_from_reader<R: Read>(reader: &mut R) -> Result<Self>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl BorshDeserialize for IpAddr

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl BorshDeserialize for SocketAddr

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl BorshDeserialize for bool

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl BorshDeserialize for f32

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl BorshDeserialize for f64

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl BorshDeserialize for i8

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl BorshDeserialize for i16

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl BorshDeserialize for i32

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl BorshDeserialize for i64

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl BorshDeserialize for i128

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl BorshDeserialize for isize

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl BorshDeserialize for u8

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl BorshDeserialize for u16

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl BorshDeserialize for u32

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl BorshDeserialize for u64

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl BorshDeserialize for u128

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl BorshDeserialize for ()

Source§

fn deserialize_reader<R: Read>(_reader: &mut R) -> Result<Self>

Source§

impl BorshDeserialize for usize

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl BorshDeserialize for String

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl BorshDeserialize for Ipv4Addr

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl BorshDeserialize for Ipv6Addr

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl BorshDeserialize for SocketAddrV4

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl BorshDeserialize for SocketAddrV6

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl BorshDeserialize for RangeFull

Source§

fn deserialize_reader<R: Read>(_reader: &mut R) -> Result<Self>

Source§

impl BorshDeserialize for NonZeroI8

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl BorshDeserialize for NonZeroI16

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl BorshDeserialize for NonZeroI32

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl BorshDeserialize for NonZeroI64

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl BorshDeserialize for NonZeroI128

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl BorshDeserialize for NonZeroU8

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl BorshDeserialize for NonZeroU16

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl BorshDeserialize for NonZeroU32

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl BorshDeserialize for NonZeroU64

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl BorshDeserialize for NonZeroU128

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl BorshDeserialize for NonZeroUsize

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<K, V> BorshDeserialize for BTreeMap<K, V>

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<K, V, H> BorshDeserialize for HashMap<K, V, H>

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T0> BorshDeserialize for (T0,)
where T0: BorshDeserialize,

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T0, T1> BorshDeserialize for (T0, T1)

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T0, T1, T2> BorshDeserialize for (T0, T1, T2)

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T0, T1, T2, T3> BorshDeserialize for (T0, T1, T2, T3)

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T0, T1, T2, T3, T4> BorshDeserialize for (T0, T1, T2, T3, T4)

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T0, T1, T2, T3, T4, T5> BorshDeserialize for (T0, T1, T2, T3, T4, T5)

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T0, T1, T2, T3, T4, T5, T6> BorshDeserialize for (T0, T1, T2, T3, T4, T5, T6)

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7> BorshDeserialize for (T0, T1, T2, T3, T4, T5, T6, T7)

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8> BorshDeserialize for (T0, T1, T2, T3, T4, T5, T6, T7, T8)

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> BorshDeserialize for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> BorshDeserialize for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> BorshDeserialize for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> BorshDeserialize for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> BorshDeserialize for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> BorshDeserialize for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> BorshDeserialize for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> BorshDeserialize for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> BorshDeserialize for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17)

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> BorshDeserialize for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18)

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> BorshDeserialize for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19)

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T> BorshDeserialize for Cow<'_, T>

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T> BorshDeserialize for Option<T>

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T> BorshDeserialize for BTreeSet<T>
where T: BorshDeserialize + Ord,

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T> BorshDeserialize for LinkedList<T>

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T> BorshDeserialize for VecDeque<T>

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T> BorshDeserialize for Vec<T>

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T> BorshDeserialize for Cell<T>

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T> BorshDeserialize for RefCell<T>

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T, E> BorshDeserialize for Result<T, E>

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T, H> BorshDeserialize for HashSet<T, H>

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T, U> BorshDeserialize for Box<T>
where U: Into<Box<T>> + Borrow<T>, T: ToOwned<Owned = U> + ?Sized, T::Owned: BorshDeserialize,

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T, const N: usize> BorshDeserialize for [T; N]

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T: BorshDeserialize> BorshDeserialize for Range<T>

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T: BorshDeserialize> BorshDeserialize for RangeFrom<T>

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T: BorshDeserialize> BorshDeserialize for RangeInclusive<T>

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T: BorshDeserialize> BorshDeserialize for RangeTo<T>

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T: BorshDeserialize> BorshDeserialize for RangeToInclusive<T>

Source§

fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>

Source§

impl<T: ?Sized> BorshDeserialize for PhantomData<T>

Implementors§