#[repr(C)]pub struct StoredAccountMeta {
pub pubkey: Address,
pub flags: u8,
}Expand description
Stored account metadata for governance/proposal-style arbitrary CPI.
The wire form is compact and owner-agnostic: a public key plus explicit
signer/writable flags. It can be stored inside dynamic tails and converted
to InstructionAccount without allocation when executing the proposal.
Fields§
§pubkey: AddressAccount public key.
flags: u8Bit 0 = signer, bit 1 = writable.
Implementations§
Source§impl StoredAccountMeta
impl StoredAccountMeta
Sourcepub const fn new(pubkey: Address, is_signer: bool, is_writable: bool) -> Self
pub const fn new(pubkey: Address, is_signer: bool, is_writable: bool) -> Self
Construct account metadata from explicit booleans.
Sourcepub const fn readonly_signer(pubkey: Address) -> Self
pub const fn readonly_signer(pubkey: Address) -> Self
Read-only signer account metadata.
Sourcepub const fn writable_signer(pubkey: Address) -> Self
pub const fn writable_signer(pubkey: Address) -> Self
Writable signer account metadata.
Sourcepub const fn is_writable(&self) -> bool
pub const fn is_writable(&self) -> bool
Whether this account must be writable.
Sourcepub fn to_instruction_account(&self) -> InstructionAccount<'_>
pub fn to_instruction_account(&self) -> InstructionAccount<'_>
Convert this stored meta to CPI metadata.
Trait Implementations§
Source§impl Clone for StoredAccountMeta
impl Clone for StoredAccountMeta
impl Copy for StoredAccountMeta
Source§impl Debug for StoredAccountMeta
impl Debug for StoredAccountMeta
impl Eq for StoredAccountMeta
Source§impl PartialEq for StoredAccountMeta
impl PartialEq for StoredAccountMeta
impl StructuralPartialEq for StoredAccountMeta
Auto Trait Implementations§
impl Freeze for StoredAccountMeta
impl RefUnwindSafe for StoredAccountMeta
impl Send for StoredAccountMeta
impl Sync for StoredAccountMeta
impl Unpin for StoredAccountMeta
impl UnsafeUnpin for StoredAccountMeta
impl UnwindSafe for StoredAccountMeta
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