pub trait ThreadAccount {
    fn pubkey(&self) -> Pubkey;
    fn init(
        &mut self,
        authority: Pubkey,
        id: String,
        kickoff_instruction: InstructionData,
        trigger: Trigger
    ) -> Result<(), Error>; fn exec(
        &mut self,
        account_infos: &[AccountInfo<'_>],
        bump: u8,
        fee: &mut Account<'_, Fee>,
        penalty: &mut Account<'_, Penalty>,
        pool: &Account<'_, Pool>,
        signatory: &mut Signer<'_>,
        worker: &Account<'_, Worker>
    ) -> Result<(), Error>; fn kickoff(
        &mut self,
        remaining_accounts: &[AccountInfo<'_>]
    ) -> Result<(), Error>; fn realloc(&mut self) -> Result<(), Error>; fn update(&mut self, settings: ThreadSettings) -> Result<(), Error>; }
Expand description

Trait for reading and writing to a thread account.

Required Methods§

source

fn pubkey(&self) -> Pubkey

Get the pubkey of the thread account.

source

fn init(
    &mut self,
    authority: Pubkey,
    id: String,
    kickoff_instruction: InstructionData,
    trigger: Trigger
) -> Result<(), Error>

Initialize the account to hold thread object.

source

fn exec(
    &mut self,
    account_infos: &[AccountInfo<'_>],
    bump: u8,
    fee: &mut Account<'_, Fee>,
    penalty: &mut Account<'_, Penalty>,
    pool: &Account<'_, Pool>,
    signatory: &mut Signer<'_>,
    worker: &Account<'_, Worker>
) -> Result<(), Error>

Execute the next instruction on the thread.

source

fn kickoff(
    &mut self,
    remaining_accounts: &[AccountInfo<'_>]
) -> Result<(), Error>

source

fn realloc(&mut self) -> Result<(), Error>

Reallocate the memory allocation for the account.

source

fn update(&mut self, settings: ThreadSettings) -> Result<(), Error>

Implementations on Foreign Types§

source§

impl ThreadAccount for Account<'_, Thread>

source§

fn pubkey(&self) -> Pubkey

source§

fn init(
    &mut self,
    authority: Pubkey,
    id: String,
    kickoff_instruction: InstructionData,
    trigger: Trigger
) -> Result<(), Error>

source§

fn exec(
    &mut self,
    account_infos: &[AccountInfo<'_>],
    bump: u8,
    fee: &mut Account<'_, Fee>,
    penalty: &mut Account<'_, Penalty>,
    pool: &Account<'_, Pool>,
    signatory: &mut Signer<'_>,
    worker: &Account<'_, Worker>
) -> Result<(), Error>

source§

fn realloc(&mut self) -> Result<(), Error>

source§

fn update(&mut self, settings: ThreadSettings) -> Result<(), Error>

source§

fn kickoff(
    &mut self,
    remaining_accounts: &[AccountInfo<'_>]
) -> Result<(), Error>

Implementors§