Struct anchor_lang::CpiStateContext
source · [−]pub struct CpiStateContext<'a, 'b, 'c, 'info, T: Accounts<'info>> { /* private fields */ }
Expand description
Context specifying non-argument inputs for cross-program-invocations targeted at program state instructions.
Implementations
sourceimpl<'a, 'b, 'c, 'info, T: Accounts<'info>> CpiStateContext<'a, 'b, 'c, 'info, T>
impl<'a, 'b, 'c, 'info, T: Accounts<'info>> CpiStateContext<'a, 'b, 'c, 'info, T>
pub fn new(
program: AccountInfo<'info>,
state: AccountInfo<'info>,
accounts: T
) -> Self
pub fn new_with_signer(
program: AccountInfo<'info>,
state: AccountInfo<'info>,
accounts: T,
signer_seeds: &'a [&'b [&'c [u8]]]
) -> Self
pub fn with_signer(self, signer_seeds: &'a [&'b [&'c [u8]]]) -> Self
pub fn program(&self) -> &AccountInfo<'info>
pub fn signer_seeds(&self) -> &[&[&[u8]]]
Trait Implementations
sourceimpl<'a, 'b, 'c, 'info, T: Accounts<'info>> ToAccountInfos<'info> for CpiStateContext<'a, 'b, 'c, 'info, T>
impl<'a, 'b, 'c, 'info, T: Accounts<'info>> ToAccountInfos<'info> for CpiStateContext<'a, 'b, 'c, 'info, T>
fn to_account_infos(&self) -> Vec<AccountInfo<'info>>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
sourceimpl<'a, 'b, 'c, 'info, T: Accounts<'info>> ToAccountMetas for CpiStateContext<'a, 'b, 'c, 'info, T>
impl<'a, 'b, 'c, 'info, T: Accounts<'info>> ToAccountMetas for CpiStateContext<'a, 'b, 'c, 'info, T>
sourcefn to_account_metas(&self, is_signer: Option<bool>) -> Vec<AccountMeta>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
fn to_account_metas(&self, is_signer: Option<bool>) -> Vec<AccountMeta>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
is_signer
is given as an optional override for the signer meta field.
This covers the edge case when a program-derived-address needs to relay
a transaction from a client to another program but sign the transaction
before the relay. The client cannot mark the field as a signer, and so
we have to override the is_signer meta field given by the client. Read more
Auto Trait Implementations
impl<'a, 'b, 'c, 'info, T> !RefUnwindSafe for CpiStateContext<'a, 'b, 'c, 'info, T>
impl<'a, 'b, 'c, 'info, T> !Send for CpiStateContext<'a, 'b, 'c, 'info, T>
impl<'a, 'b, 'c, 'info, T> !Sync for CpiStateContext<'a, 'b, 'c, 'info, T>
impl<'a, 'b, 'c, 'info, T> Unpin for CpiStateContext<'a, 'b, 'c, 'info, T> where
T: Unpin,
'b: 'a,
'c: 'a,
impl<'a, 'b, 'c, 'info, T> !UnwindSafe for CpiStateContext<'a, 'b, 'c, 'info, T>
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