Trait borsh::de::BorshDeserialize[][src]

pub trait BorshDeserialize: Sized {
    fn deserialize(buf: &mut &[u8]) -> Result<Self>;

    fn try_from_slice(v: &[u8]) -> Result<Self> { ... }
fn is_u8() -> bool { ... } }

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

Required methods

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

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

Loading content...

Provided methods

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

Deserialize this instance from a slice of bytes.

fn is_u8() -> bool[src]

Whether Self is u8. NOTE: Vec<u8> is the most common use-case for serialization and deserialization, it’s worth handling it as a special case to improve performance. It’s a workaround for specific Vec<u8> implementation versus generic Vec<T> implementation. See https://github.com/rust-lang/rfcs/pull/1210 for details.

Loading content...

Implementations on Foreign Types

impl BorshDeserialize for u8[src]

impl BorshDeserialize for i8[src]

impl BorshDeserialize for i16[src]

impl BorshDeserialize for i32[src]

impl BorshDeserialize for i64[src]

impl BorshDeserialize for i128[src]

impl BorshDeserialize for u16[src]

impl BorshDeserialize for u32[src]

impl BorshDeserialize for u64[src]

impl BorshDeserialize for u128[src]

impl BorshDeserialize for usize[src]

impl BorshDeserialize for f32[src]

impl BorshDeserialize for f64[src]

impl BorshDeserialize for bool[src]

impl<T> BorshDeserialize for Option<T> where
    T: BorshDeserialize
[src]

impl<T, E> BorshDeserialize for Result<T, E> where
    T: BorshDeserialize,
    E: BorshDeserialize
[src]

impl BorshDeserialize for SocketAddr[src]

impl BorshDeserialize for SocketAddrV4[src]

impl BorshDeserialize for SocketAddrV6[src]

impl BorshDeserialize for Ipv4Addr[src]

impl BorshDeserialize for Ipv6Addr[src]

impl<T> BorshDeserialize for [T; 1] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 2] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 3] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 4] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 5] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 6] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 7] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 8] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 9] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 10] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 11] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 12] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 13] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 14] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 15] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 16] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 17] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 18] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 19] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 20] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 21] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 22] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 23] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 24] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 25] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 26] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 27] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 28] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 29] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 30] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 31] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 32] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 64] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 65] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 128] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 256] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 512] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 1024] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 2048] where
    T: BorshDeserialize + Default + Copy
[src]

impl<T> BorshDeserialize for [T; 0] where
    T: BorshDeserialize + Default + Copy
[src]

impl BorshDeserialize for ()[src]

impl<T0, T1> BorshDeserialize for (T0, T1) where
    T0: BorshDeserialize,
    T1: BorshDeserialize
[src]

impl<T0, T1, T2> BorshDeserialize for (T0, T1, T2) where
    T0: BorshDeserialize,
    T1: BorshDeserialize,
    T2: BorshDeserialize
[src]

impl<T0, T1, T2, T3> BorshDeserialize for (T0, T1, T2, T3) where
    T0: BorshDeserialize,
    T1: BorshDeserialize,
    T2: BorshDeserialize,
    T3: BorshDeserialize
[src]

impl<T0, T1, T2, T3, T4> BorshDeserialize for (T0, T1, T2, T3, T4) where
    T0: BorshDeserialize,
    T1: BorshDeserialize,
    T2: BorshDeserialize,
    T3: BorshDeserialize,
    T4: BorshDeserialize
[src]

impl<T0, T1, T2, T3, T4, T5> BorshDeserialize for (T0, T1, T2, T3, T4, T5) where
    T0: BorshDeserialize,
    T1: BorshDeserialize,
    T2: BorshDeserialize,
    T3: BorshDeserialize,
    T4: BorshDeserialize,
    T5: BorshDeserialize
[src]

impl<T0, T1, T2, T3, T4, T5, T6> BorshDeserialize for (T0, T1, T2, T3, T4, T5, T6) where
    T0: BorshDeserialize,
    T1: BorshDeserialize,
    T2: BorshDeserialize,
    T3: BorshDeserialize,
    T4: BorshDeserialize,
    T5: BorshDeserialize,
    T6: BorshDeserialize
[src]

impl<T0, T1, T2, T3, T4, T5, T6, T7> BorshDeserialize for (T0, T1, T2, T3, T4, T5, T6, T7) where
    T0: BorshDeserialize,
    T1: BorshDeserialize,
    T2: BorshDeserialize,
    T3: BorshDeserialize,
    T4: BorshDeserialize,
    T5: BorshDeserialize,
    T6: BorshDeserialize,
    T7: BorshDeserialize
[src]

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8> BorshDeserialize for (T0, T1, T2, T3, T4, T5, T6, T7, T8) where
    T0: BorshDeserialize,
    T1: BorshDeserialize,
    T2: BorshDeserialize,
    T3: BorshDeserialize,
    T4: BorshDeserialize,
    T5: BorshDeserialize,
    T6: BorshDeserialize,
    T7: BorshDeserialize,
    T8: BorshDeserialize
[src]

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> BorshDeserialize for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) where
    T0: BorshDeserialize,
    T1: BorshDeserialize,
    T2: BorshDeserialize,
    T3: BorshDeserialize,
    T4: BorshDeserialize,
    T5: BorshDeserialize,
    T6: BorshDeserialize,
    T7: BorshDeserialize,
    T8: BorshDeserialize,
    T9: BorshDeserialize
[src]

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) where
    T0: BorshDeserialize,
    T1: BorshDeserialize,
    T2: BorshDeserialize,
    T3: BorshDeserialize,
    T4: BorshDeserialize,
    T5: BorshDeserialize,
    T6: BorshDeserialize,
    T7: BorshDeserialize,
    T8: BorshDeserialize,
    T9: BorshDeserialize,
    T10: BorshDeserialize
[src]

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) where
    T0: BorshDeserialize,
    T1: BorshDeserialize,
    T2: BorshDeserialize,
    T3: BorshDeserialize,
    T4: BorshDeserialize,
    T5: BorshDeserialize,
    T6: BorshDeserialize,
    T7: BorshDeserialize,
    T8: BorshDeserialize,
    T9: BorshDeserialize,
    T10: BorshDeserialize,
    T11: BorshDeserialize
[src]

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) where
    T0: BorshDeserialize,
    T1: BorshDeserialize,
    T2: BorshDeserialize,
    T3: BorshDeserialize,
    T4: BorshDeserialize,
    T5: BorshDeserialize,
    T6: BorshDeserialize,
    T7: BorshDeserialize,
    T8: BorshDeserialize,
    T9: BorshDeserialize,
    T10: BorshDeserialize,
    T11: BorshDeserialize,
    T12: BorshDeserialize
[src]

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) where
    T0: BorshDeserialize,
    T1: BorshDeserialize,
    T2: BorshDeserialize,
    T3: BorshDeserialize,
    T4: BorshDeserialize,
    T5: BorshDeserialize,
    T6: BorshDeserialize,
    T7: BorshDeserialize,
    T8: BorshDeserialize,
    T9: BorshDeserialize,
    T10: BorshDeserialize,
    T11: BorshDeserialize,
    T12: BorshDeserialize,
    T13: BorshDeserialize
[src]

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) where
    T0: BorshDeserialize,
    T1: BorshDeserialize,
    T2: BorshDeserialize,
    T3: BorshDeserialize,
    T4: BorshDeserialize,
    T5: BorshDeserialize,
    T6: BorshDeserialize,
    T7: BorshDeserialize,
    T8: BorshDeserialize,
    T9: BorshDeserialize,
    T10: BorshDeserialize,
    T11: BorshDeserialize,
    T12: BorshDeserialize,
    T13: BorshDeserialize,
    T14: BorshDeserialize
[src]

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) where
    T0: BorshDeserialize,
    T1: BorshDeserialize,
    T2: BorshDeserialize,
    T3: BorshDeserialize,
    T4: BorshDeserialize,
    T5: BorshDeserialize,
    T6: BorshDeserialize,
    T7: BorshDeserialize,
    T8: BorshDeserialize,
    T9: BorshDeserialize,
    T10: BorshDeserialize,
    T11: BorshDeserialize,
    T12: BorshDeserialize,
    T13: BorshDeserialize,
    T14: BorshDeserialize,
    T15: BorshDeserialize
[src]

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) where
    T0: BorshDeserialize,
    T1: BorshDeserialize,
    T2: BorshDeserialize,
    T3: BorshDeserialize,
    T4: BorshDeserialize,
    T5: BorshDeserialize,
    T6: BorshDeserialize,
    T7: BorshDeserialize,
    T8: BorshDeserialize,
    T9: BorshDeserialize,
    T10: BorshDeserialize,
    T11: BorshDeserialize,
    T12: BorshDeserialize,
    T13: BorshDeserialize,
    T14: BorshDeserialize,
    T15: BorshDeserialize,
    T16: BorshDeserialize
[src]

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) where
    T0: BorshDeserialize,
    T1: BorshDeserialize,
    T2: BorshDeserialize,
    T3: BorshDeserialize,
    T4: BorshDeserialize,
    T5: BorshDeserialize,
    T6: BorshDeserialize,
    T7: BorshDeserialize,
    T8: BorshDeserialize,
    T9: BorshDeserialize,
    T10: BorshDeserialize,
    T11: BorshDeserialize,
    T12: BorshDeserialize,
    T13: BorshDeserialize,
    T14: BorshDeserialize,
    T15: BorshDeserialize,
    T16: BorshDeserialize,
    T17: BorshDeserialize
[src]

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) where
    T0: BorshDeserialize,
    T1: BorshDeserialize,
    T2: BorshDeserialize,
    T3: BorshDeserialize,
    T4: BorshDeserialize,
    T5: BorshDeserialize,
    T6: BorshDeserialize,
    T7: BorshDeserialize,
    T8: BorshDeserialize,
    T9: BorshDeserialize,
    T10: BorshDeserialize,
    T11: BorshDeserialize,
    T12: BorshDeserialize,
    T13: BorshDeserialize,
    T14: BorshDeserialize,
    T15: BorshDeserialize,
    T16: BorshDeserialize,
    T17: BorshDeserialize,
    T18: BorshDeserialize
[src]

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) where
    T0: BorshDeserialize,
    T1: BorshDeserialize,
    T2: BorshDeserialize,
    T3: BorshDeserialize,
    T4: BorshDeserialize,
    T5: BorshDeserialize,
    T6: BorshDeserialize,
    T7: BorshDeserialize,
    T8: BorshDeserialize,
    T9: BorshDeserialize,
    T10: BorshDeserialize,
    T11: BorshDeserialize,
    T12: BorshDeserialize,
    T13: BorshDeserialize,
    T14: BorshDeserialize,
    T15: BorshDeserialize,
    T16: BorshDeserialize,
    T17: BorshDeserialize,
    T18: BorshDeserialize,
    T19: BorshDeserialize
[src]

Loading content...

Implementors

impl BorshDeserialize for Definition where
    u32: BorshDeserialize,
    Declaration: BorshDeserialize,
    Declaration: BorshDeserialize,
    Vec<Declaration>: BorshDeserialize,
    Vec<(VariantName, Declaration)>: BorshDeserialize,
    Fields: BorshDeserialize
[src]

impl BorshDeserialize for Fields where
    Vec<(FieldName, Declaration)>: BorshDeserialize,
    Vec<Declaration>: BorshDeserialize
[src]

impl BorshDeserialize for String[src]

impl BorshDeserialize for BorshSchemaContainer where
    Declaration: BorshDeserialize,
    HashMap<Declaration, Definition>: BorshDeserialize
[src]

impl<K, V> BorshDeserialize for BTreeMap<K, V> where
    K: BorshDeserialize + Ord + Hash,
    V: BorshDeserialize
[src]

impl<K, V> BorshDeserialize for HashMap<K, V> where
    K: BorshDeserialize + Eq + Hash,
    V: BorshDeserialize
[src]

impl<T> BorshDeserialize for BTreeSet<T> where
    T: BorshDeserialize + Ord
[src]

impl<T> BorshDeserialize for BinaryHeap<T> where
    T: BorshDeserialize + Ord
[src]

impl<T> BorshDeserialize for HashSet<T> where
    T: BorshDeserialize + Eq + Hash
[src]

impl<T> BorshDeserialize for LinkedList<T> where
    T: BorshDeserialize
[src]

impl<T> BorshDeserialize for VecDeque<T> where
    T: BorshDeserialize
[src]

impl<T> BorshDeserialize for Vec<T> where
    T: BorshDeserialize
[src]

impl<T: ?Sized> BorshDeserialize for Cow<'_, T> where
    T: ToOwned,
    T::Owned: BorshDeserialize
[src]

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

Loading content...