Skip to main content

InterfaceAccountResolve

Trait InterfaceAccountResolve 

Source
pub trait InterfaceAccountResolve: InterfaceAccountLayout {
    type Resolved<'a>
       where Self: 'a;

    // Required method
    fn resolve<'a>(
        view: &'a AccountView,
    ) -> Result<Self::Resolved<'a>, ProgramError>;
}
Expand description

Runtime resolver for marker interface account layouts.

Implement this for an InterfaceAccountLayout marker when one account slot may legally hold several concrete Hopper layouts, for example a migration reader that accepts VaultV1 or VaultV2. The marker’s validate_interface_account should accept exactly the same variants that resolve can return.

Required Associated Types§

Source

type Resolved<'a> where Self: 'a

Borrowed resolved view returned by InterfaceAccount::resolve.

Required Methods§

Source

fn resolve<'a>( view: &'a AccountView, ) -> Result<Self::Resolved<'a>, ProgramError>

Resolve the account bytes to a concrete borrowed variant.

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.

Implementors§