Skip to main content

AccountWrapper

Trait AccountWrapper 

Source
pub trait AccountWrapper: ActiveAccount + Default {
    // Provided method
    fn active() -> Self { ... }
}
Expand description

Marker trait for account API wrapper types.

The #[note] and #[tx_script] macros instantiate their entrypoint account parameter through this trait, so that parameter must be a type implementing it. The ActiveAccount supertrait guarantees that parameter is usable as the transaction’s active account and keeps unrelated Default types from satisfying the bound. The #[account(...)] macro implements both automatically; it is not a sealed capability boundary, so manual implementations are possible but normally unnecessary.

Provided Methods§

Source

fn active() -> Self

Creates a binding to the transaction’s active account.

This is the account the transaction executes against, as opposed to a foreign account reached through FPI (created with new).

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§