solana_sdk::account_utils

Trait StateMut

Source
pub trait StateMut<T> {
    // Required methods
    fn state(&self) -> Result<T, InstructionError>;
    fn set_state(&mut self, state: &T) -> Result<(), InstructionError>;
}
Expand description

Convenience trait to covert bincode errors to instruction errors.

Required Methods§

Source

fn state(&self) -> Result<T, InstructionError>

Source

fn set_state(&mut self, state: &T) -> Result<(), InstructionError>

Implementations on Foreign Types§

Source§

impl<T> StateMut<T> for Ref<'_, AccountSharedData>

Implementors§