pub struct TokenAccount(/* private fields */);Implementations§
Methods from Deref<Target = SplTokenAccount>§
pub const LEN: usize
pub fn mint(&self) -> &Address
pub fn owner(&self) -> &Address
pub fn amount(&self) -> u64
pub fn has_delegate(&self) -> bool
pub fn delegate(&self) -> Option<&Address>
Sourcepub fn delegate_unchecked(&self) -> &Address
pub fn delegate_unchecked(&self) -> &Address
Use this when you know the account will have a delegate and want to skip the Option check.
pub fn state(&self) -> AccountState
pub fn is_native(&self) -> bool
pub fn native_amount(&self) -> Option<u64>
Sourcepub fn native_amount_unchecked(&self) -> u64
pub fn native_amount_unchecked(&self) -> u64
Return the native amount.
This method should be used when the caller knows that the token is native since it
skips the Option check.
pub fn delegated_amount(&self) -> u64
Return the close authority.
This method should be used when the caller knows that the token will have a close
authority set since it skips the Option check.
pub fn is_initialized(&self) -> bool
pub fn is_frozen(&self) -> bool
Trait Implementations§
Source§impl Deref for TokenAccount
impl Deref for TokenAccount
Source§impl Discriminator for TokenAccount
impl Discriminator for TokenAccount
Source§const DISCRIMINATOR: &'static [u8]
const DISCRIMINATOR: &'static [u8]
The discriminator bytes.
Auto Trait Implementations§
impl Freeze for TokenAccount
impl RefUnwindSafe for TokenAccount
impl Send for TokenAccount
impl Sync for TokenAccount
impl Unpin for TokenAccount
impl UnwindSafe for TokenAccount
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more