Struct anchor_lang::idl::IdlAccount
source · [−]Fields
data: Vec<u8>
Implementations
Trait Implementations
sourceimpl AccountDeserialize for IdlAccount
impl AccountDeserialize for IdlAccount
sourcefn try_deserialize(buf: &mut &[u8]) -> Result<Self, ProgramError>
fn try_deserialize(buf: &mut &[u8]) -> Result<Self, ProgramError>
Deserializes previously initialized account data. Should fail for all
uninitialized accounts, where the bytes are zeroed. Implementations
should be unique to a particular account type so that one can never
successfully deserialize the data of one account type into another.
For example, if the SPL token program where to implement this trait,
it should impossible to deserialize a Mint
account into a token
Account
. Read more
sourcefn try_deserialize_unchecked(buf: &mut &[u8]) -> Result<Self, ProgramError>
fn try_deserialize_unchecked(buf: &mut &[u8]) -> Result<Self, ProgramError>
Deserializes account data without checking the account discriminator. This should only be used on account initialization, when the bytes of the account are zeroed. Read more
sourceimpl AccountSerialize for IdlAccount
impl AccountSerialize for IdlAccount
sourcefn try_serialize<W: Write>(&self, writer: &mut W) -> Result<(), ProgramError>
fn try_serialize<W: Write>(&self, writer: &mut W) -> Result<(), ProgramError>
Serializes the account data into writer
.
sourceimpl BorshDeserialize for IdlAccount where
Pubkey: BorshDeserialize,
Vec<u8>: BorshDeserialize,
impl BorshDeserialize for IdlAccount where
Pubkey: BorshDeserialize,
Vec<u8>: BorshDeserialize,
sourcefn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
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. Read more
sourcefn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
sourcefn is_u8() -> bool
fn is_u8() -> bool
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. Read more
sourceimpl BorshSerialize for IdlAccount where
Pubkey: BorshSerialize,
Vec<u8>: BorshSerialize,
impl BorshSerialize for IdlAccount where
Pubkey: BorshSerialize,
Vec<u8>: BorshSerialize,
fn serialize<W: Write>(&self, writer: &mut W) -> Result<(), Error>
sourcefn try_to_vec(&self) -> Result<Vec<u8, Global>, Error>
fn try_to_vec(&self) -> Result<Vec<u8, Global>, Error>
Serialize this instance into a vector of bytes.
sourcefn is_u8() -> bool
fn is_u8() -> bool
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. Read more
sourceimpl Clone for IdlAccount
impl Clone for IdlAccount
sourcefn clone(&self) -> IdlAccount
fn clone(&self) -> IdlAccount
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for IdlAccount
impl Send for IdlAccount
impl Sync for IdlAccount
impl Unpin for IdlAccount
impl UnwindSafe for IdlAccount
Blanket Implementations
impl<T> AbiExample for T
impl<T> AbiExample for T
default fn example() -> T
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more