Struct Account

Source
#[repr(C)]
pub struct Account { pub mint: Pubkey, pub owner: Pubkey, pub state: AccountState, /* private fields */ }
Expand description

Internal representation of a token account data.

Fields§

§mint: Pubkey

The mint associated with this account

§owner: Pubkey

The owner of this account.

§state: AccountState

The account’s state.

Implementations§

Source§

impl Account

Source

pub fn set_amount(&mut self, amount: u64)

Source

pub fn amount(&self) -> u64

Source

pub fn clear_delegate(&mut self)

Source

pub fn set_delegate(&mut self, delegate: &Pubkey)

Source

pub fn delegate(&self) -> Option<&Pubkey>

Source

pub fn set_native(&mut self, value: bool)

Source

pub fn is_native(&self) -> bool

Source

pub fn set_native_amount(&mut self, amount: u64)

Source

pub fn native_amount(&self) -> Option<u64>

Source

pub fn set_delegated_amount(&mut self, amount: u64)

Source

pub fn delegated_amount(&self) -> u64

Source

pub fn clear_close_authority(&mut self)

Source

pub fn set_close_authority(&mut self, value: &Pubkey)

Source

pub fn close_authority(&self) -> Option<&Pubkey>

Source

pub fn is_frozen(&self) -> bool

Source

pub fn is_owned_by_system_program_or_incinerator(&self) -> bool

Trait Implementations§

Source§

impl Initializable for Account

Source§

fn is_initialized(&self) -> bool

Return true if the object is initialized.
Source§

impl RawType for Account

Source§

const LEN: usize = 165usize

The length of the type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.