#[repr(C)]
pub struct Account { pub mint: Pubkey, pub owner: Pubkey, pub amount: u64, pub delegate: COption<Pubkey>, pub state: AccountState, pub is_native: COption<u64>, pub delegated_amount: u64, pub close_authority: COption<Pubkey>, }
Expand description

Account data.

Fields

mint: Pubkey

The mint associated with this account

owner: Pubkey

The owner of this account.

amount: u64

The amount of tokens this account holds.

delegate: COption<Pubkey>

If delegate is Some then delegated_amount represents the amount authorized by the delegate

state: AccountState

The account’s state

is_native: COption<u64>

If is_native.is_some, this is a native token, and the value logs the rent-exempt reserve. An Account is required to be rent-exempt, so the value is used by the Processor to ensure that wrapped SOL accounts do not drop below this threshold.

delegated_amount: u64

The amount delegated

close_authority: COption<Pubkey>

Optional authority to close the account.

Implementations

Checks if account is frozen

Checks if account is native

Checks if a token Account’s owner is the system_program or the incinerator

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Check if the account data is a valid token account

Call after account length has already been verified to unpack the account owner

Call after account length has already been verified to unpack the account mint

Call after account length has already been verified to unpack a Pubkey at the specified offset. Panics if account_data.len() is less than PUBKEY_BYTES Read more

Unpacks an account’s owner from opaque account data.

Unpacks an account’s mint from opaque account data.

Is initialized

The length, in bytes, of the packed representation

Get the packed length

Unpack from slice and check if initialized

Unpack from slice without checking if initialized

Pack into slice

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.