#[repr(C)]pub struct AccountMeta {
pub pubkey: Pubkey,
pub is_signer: bool,
pub is_writable: bool,
}Expand description
Meta information about an account used to define its role in an instruction. This includes whether the account is a signer and if it’s writable.
Fields§
§pubkey: Pubkey§is_signer: bool§is_writable: boolImplementations§
Source§impl AccountMeta
impl AccountMeta
Sourcepub fn new(pubkey: Pubkey, is_signer: bool) -> Self
pub fn new(pubkey: Pubkey, is_signer: bool) -> Self
Creates a new AccountMeta with the given public key as a writable account.
§Arguments
pubkey- The account’s public keyis_signer- Whether this account is a transaction signer
Sourcepub fn new_readonly(pubkey: Pubkey, is_signer: bool) -> Self
pub fn new_readonly(pubkey: Pubkey, is_signer: bool) -> Self
Creates a new read-only AccountMeta with the given public key.
§Arguments
pubkey- The account’s public keyis_signer- Whether this account is a transaction signer
Sourcepub fn serialize(&self) -> [u8; 34]
pub fn serialize(&self) -> [u8; 34]
Serializes the AccountMeta into a fixed-size byte array.
§Returns
A 34-byte array containing the serialized account metadata
Sourcepub fn from_slice(data: &[u8]) -> Result<Self, SerialisationErrors>
pub fn from_slice(data: &[u8]) -> Result<Self, SerialisationErrors>
Trait Implementations§
Source§impl BorshDeserialize for AccountMeta
impl BorshDeserialize for AccountMeta
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
Source§fn 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.
Source§fn 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.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSerialize for AccountMeta
impl BorshSerialize for AccountMeta
Source§impl Clone for AccountMeta
impl Clone for AccountMeta
Source§fn clone(&self) -> AccountMeta
fn clone(&self) -> AccountMeta
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AccountMeta
impl Debug for AccountMeta
impl<'__de> Decode<'__de> for AccountMetawhere
'__de:,
Source§impl<'de> Deserialize<'de> for AccountMeta
impl<'de> Deserialize<'de> for AccountMeta
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Encode for AccountMeta
impl Eq for AccountMeta
Source§impl PartialEq for AccountMeta
impl PartialEq for AccountMeta
Source§impl Serialize for AccountMeta
impl Serialize for AccountMeta
impl StructuralPartialEq for AccountMeta
Auto Trait Implementations§
impl Freeze for AccountMeta
impl RefUnwindSafe for AccountMeta
impl Send for AccountMeta
impl Sync for AccountMeta
impl Unpin for AccountMeta
impl UnsafeUnpin for AccountMeta
impl UnwindSafe for AccountMeta
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more