pub trait AnchorDeserialize: Sized {
    // Required method
    fn deserialize_reader<R>(reader: &mut R) -> Result<Self, Error>
       where R: Read;

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

Borsh is the default serialization format for instructions and accounts. A data-structure that can be de-serialized from binary format by NBOR.

Required Methods§

source

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

Provided Methods§

source

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

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, Error>

Deserialize this instance from a slice of bytes.

source

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

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl BorshDeserialize for SocketAddr

source§

impl BorshDeserialize for StakeState

source§

impl BorshDeserialize for StakeStateV2

source§

impl BorshDeserialize for bool

source§

fn deserialize_reader<R>(reader: &mut R) -> Result<bool, Error>where R: Read,

source§

impl BorshDeserialize for f32

source§

fn deserialize_reader<R>(reader: &mut R) -> Result<f32, Error>where R: Read,

source§

impl BorshDeserialize for f64

source§

fn deserialize_reader<R>(reader: &mut R) -> Result<f64, Error>where R: Read,

source§

impl BorshDeserialize for i8

source§

fn deserialize_reader<R>(reader: &mut R) -> Result<i8, Error>where R: Read,

source§

impl BorshDeserialize for i16

source§

fn deserialize_reader<R>(reader: &mut R) -> Result<i16, Error>where R: Read,

source§

impl BorshDeserialize for i32

source§

fn deserialize_reader<R>(reader: &mut R) -> Result<i32, Error>where R: Read,

source§

impl BorshDeserialize for i64

source§

fn deserialize_reader<R>(reader: &mut R) -> Result<i64, Error>where R: Read,

source§

impl BorshDeserialize for i128

source§

fn deserialize_reader<R>(reader: &mut R) -> Result<i128, Error>where R: Read,

source§

impl BorshDeserialize for isize

source§

impl BorshDeserialize for u8

source§

fn deserialize_reader<R>(reader: &mut R) -> Result<u8, Error>where R: Read,

source§

impl BorshDeserialize for u16

source§

fn deserialize_reader<R>(reader: &mut R) -> Result<u16, Error>where R: Read,

source§

impl BorshDeserialize for u32

source§

fn deserialize_reader<R>(reader: &mut R) -> Result<u32, Error>where R: Read,

source§

impl BorshDeserialize for u64

source§

fn deserialize_reader<R>(reader: &mut R) -> Result<u64, Error>where R: Read,

source§

impl BorshDeserialize for u128

source§

fn deserialize_reader<R>(reader: &mut R) -> Result<u128, Error>where R: Read,

source§

impl BorshDeserialize for ()

source§

fn deserialize_reader<R>(_reader: &mut R) -> Result<(), Error>where R: Read,

source§

impl BorshDeserialize for usize

source§

impl BorshDeserialize for String

source§

impl BorshDeserialize for Ipv4Addr

source§

impl BorshDeserialize for Ipv6Addr

source§

impl BorshDeserialize for SocketAddrV4

source§

impl BorshDeserialize for SocketAddrV6

source§

impl BorshDeserialize for NonZeroI8

source§

impl BorshDeserialize for NonZeroI16

source§

impl BorshDeserialize for NonZeroI32

source§

impl BorshDeserialize for NonZeroI64

source§

impl BorshDeserialize for NonZeroI128

source§

impl BorshDeserialize for NonZeroU8

source§

impl BorshDeserialize for NonZeroU16

source§

impl BorshDeserialize for NonZeroU32

source§

impl BorshDeserialize for NonZeroU64

source§

impl BorshDeserialize for NonZeroU128

source§

impl BorshDeserialize for NonZeroUsize

source§

impl BorshDeserialize for Hash

source§

fn deserialize_reader<R>(reader: &mut R) -> Result<Hash, Error>where R: Read,

source§

impl BorshDeserialize for Hash

source§

fn deserialize_reader<R>(reader: &mut R) -> Result<Hash, Error>where R: Read,

source§

impl BorshDeserialize for Hash

source§

fn deserialize_reader<R>(reader: &mut R) -> Result<Hash, Error>where R: Read,

source§

impl BorshDeserialize for Secp256k1Pubkey

source§

impl BorshDeserialize for StakeFlagswhere u8: BorshDeserialize,

source§

impl BorshDeserialize for Authorizedwhere Pubkey: BorshDeserialize,

source§

impl BorshDeserialize for Delegationwhere Pubkey: BorshDeserialize, u64: BorshDeserialize, f64: BorshDeserialize,

source§

impl BorshDeserialize for Lockupwhere i64: BorshDeserialize, u64: BorshDeserialize, Pubkey: BorshDeserialize,

source§

impl BorshDeserialize for Metawhere u64: BorshDeserialize, Authorized: BorshDeserialize, Lockup: BorshDeserialize,

source§

fn deserialize_reader<R>(reader: &mut R) -> Result<Meta, Error>where R: Read,

source§

impl BorshDeserialize for Stakewhere Delegation: BorshDeserialize, u64: BorshDeserialize,

source§

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

source§

fn deserialize_reader<R>(reader: &mut R) -> Result<BTreeMap<K, V>, Error>where R: Read,

source§

impl<K, V, H> BorshDeserialize for HashMap<K, V, H>where K: BorshDeserialize + Eq + Hash, V: BorshDeserialize, H: BuildHasher + Default,

source§

fn deserialize_reader<R>(reader: &mut R) -> Result<HashMap<K, V, H>, Error>where R: Read,

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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,

source§

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,

source§

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,

source§

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,

source§

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,

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

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)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,

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)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,

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)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,

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)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,

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)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,

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)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,

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)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,

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)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,

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)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,

source§

impl<T> BorshDeserialize for Cow<'_, T>where T: ToOwned + ?Sized, <T as ToOwned>::Owned: BorshDeserialize,

source§

fn deserialize_reader<R>(reader: &mut R) -> Result<Cow<'_, T>, Error>where R: Read,

source§

impl<T> BorshDeserialize for Option<T>where T: BorshDeserialize,

source§

fn deserialize_reader<R>(reader: &mut R) -> Result<Option<T>, Error>where R: Read,

source§

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

source§

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

source§

fn deserialize_reader<R>(reader: &mut R) -> Result<BTreeSet<T>, Error>where R: Read,

source§

impl<T> BorshDeserialize for LinkedList<T>where T: BorshDeserialize,

source§

impl<T> BorshDeserialize for VecDeque<T>where T: BorshDeserialize,

source§

fn deserialize_reader<R>(reader: &mut R) -> Result<VecDeque<T>, Error>where R: Read,

source§

impl<T> BorshDeserialize for Vec<T>where T: BorshDeserialize,

source§

fn deserialize_reader<R>(reader: &mut R) -> Result<Vec<T>, Error>where R: Read,

source§

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

source§

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

source§

fn deserialize_reader<R>(reader: &mut R) -> Result<Range<T>, Error>where R: Read,

source§

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

source§

fn deserialize_reader<R>(reader: &mut R) -> Result<Result<T, E>, Error>where R: Read,

source§

impl<T, H> BorshDeserialize for HashSet<T, H>where T: BorshDeserialize + Eq + Hash, H: BuildHasher + Default,

source§

fn deserialize_reader<R>(reader: &mut R) -> Result<HashSet<T, H>, Error>where R: Read,

source§

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

source§

fn deserialize_reader<R>(reader: &mut R) -> Result<Box<T>, Error>where R: Read,

source§

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

Implementors§