Skip to main content

InterfaceSpec

Trait InterfaceSpec 

Source
pub trait InterfaceSpec: 'static {
    const IDS: &'static [Address];

    // Provided method
    fn contains(program_id: &Address) -> bool { ... }
}
Expand description

Compile-time owner/program set for generic interface wrappers.

Implement this on a zero-sized marker type when a program context accepts one of several compatible programs. Interface<'info, I> validates an executable program account by key against this set, while InterfaceAccount<'info, T> validates account ownership through T::Interface.

Required Associated Constants§

Source

const IDS: &'static [Address]

Program IDs accepted by this interface.

Provided Methods§

Source

fn contains(program_id: &Address) -> bool

Whether program_id belongs to this interface.

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§