Skip to main content

ExternalResolve

Trait ExternalResolve 

Source
pub trait ExternalResolve {
    type Resolved<'a>;

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

Owner/discriminator-selected resolver for external account families.

Use this for account sets such as Pyth/Switchboard/custom oracle unions or Token/Token-2022 interfaces where the account owner decides which zero-copy view should be used at runtime.

Required Associated Types§

Source

type Resolved<'a>

Guard-owned resolved view.

Required Methods§

Source

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

Resolve the account into one of the supported external views.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§