solana_inline_spl::token

Trait GenericTokenAccount

Source
pub trait GenericTokenAccount {
    // Required method
    fn valid_account_data(account_data: &[u8]) -> bool;

    // Provided methods
    fn unpack_account_owner_unchecked(account_data: &[u8]) -> &Pubkey { ... }
    fn unpack_account_mint_unchecked(account_data: &[u8]) -> &Pubkey { ... }
    fn unpack_pubkey_unchecked(account_data: &[u8], offset: usize) -> &Pubkey { ... }
    fn unpack_account_owner(account_data: &[u8]) -> Option<&Pubkey> { ... }
    fn unpack_account_mint(account_data: &[u8]) -> Option<&Pubkey> { ... }
}

Required Methods§

Source

fn valid_account_data(account_data: &[u8]) -> bool

Provided Methods§

Source

fn unpack_account_owner_unchecked(account_data: &[u8]) -> &Pubkey

Source

fn unpack_account_mint_unchecked(account_data: &[u8]) -> &Pubkey

Source

fn unpack_pubkey_unchecked(account_data: &[u8], offset: usize) -> &Pubkey

Source

fn unpack_account_owner(account_data: &[u8]) -> Option<&Pubkey>

Source

fn unpack_account_mint(account_data: &[u8]) -> Option<&Pubkey>

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§

Source§

impl GenericTokenAccount for solana_inline_spl::token_2022::Account

Source§

impl GenericTokenAccount for solana_inline_spl::token::Account