Skip to main content

FieldRules

Trait FieldRules 

Source
pub trait FieldRules {
    // Required methods
    fn check_rules(&self) -> ProgramResult;
    fn check_account(account: &AccountView<'_>) -> ProgramResult;
}
Expand description

A layout with value rules: #[check(..)] on a field of a #[hopper::state] struct implements this.

Required Methods§

Source

fn check_rules(&self) -> ProgramResult

Check every rule against this value and return the first failure.

Source

fn check_account(account: &AccountView<'_>) -> ProgramResult

Load the layout from account and check its rules.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§