solana_account::state_traits

Trait StateMut

Source
pub trait StateMut<T> {
    // Required methods
    fn state(&self) -> Result<T, InstructionError>;
    fn set_state(&mut self, state: &T) -> Result<(), InstructionError>;
}
Available on crate feature bincode only.
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§