pub trait LightCpiInstruction: Sized {
// Required methods
fn new_cpi(cpi_signer: CpiSigner, proof: ValidityProof) -> Self;
fn with_light_account<A>(
self,
account: LightAccount<A>,
) -> Result<Self, ProgramError>
where A: AnchorSerialize + AnchorDeserialize + LightDiscriminator + Default;
fn get_mode(&self) -> u8;
fn get_bump(&self) -> u8;
}Expand description
Trait for Light CPI instruction types
Required Methods§
Sourcefn new_cpi(cpi_signer: CpiSigner, proof: ValidityProof) -> Self
fn new_cpi(cpi_signer: CpiSigner, proof: ValidityProof) -> Self
Creates a new CPI instruction builder with a validity proof.
§Arguments
cpi_signer- The CPI signer containing program ID and bump seedproof- Validity proof for compressed account operations
Sourcefn with_light_account<A>(
self,
account: LightAccount<A>,
) -> Result<Self, ProgramError>
fn with_light_account<A>( self, account: LightAccount<A>, ) -> Result<Self, ProgramError>
Adds a compressed account to the instruction (using SHA256 hashing).
The account can be an input (for updating/closing), output (for creating/updating), or both. The method automatically handles the conversion based on the account state.
§Arguments
account- The light account to add to the instruction
§Type Parameters
A- The compressed account data type
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.