pub trait FromAccount<'a>: Sized {
// Required method
fn from_account(
account: &'a AccountView,
program_id: &Address,
) -> Result<Self, ProgramError>;
}Expand description
Trait for types that can be constructed from an AccountView with validation.
Required Methods§
Sourcefn from_account(
account: &'a AccountView,
program_id: &Address,
) -> Result<Self, ProgramError>
fn from_account( account: &'a AccountView, program_id: &Address, ) -> Result<Self, ProgramError>
Construct this type from an account, performing all required validation.
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.