pub struct TokenAccount(/* private fields */);Implementations§
Methods from Deref<Target = SplTokenAccount>§
pub const LEN: usize = 165usize
pub fn mint(&self) -> &[u8; 32]
pub fn owner(&self) -> &[u8; 32]
pub fn amount(&self) -> u64
pub fn has_delegate(&self) -> bool
pub fn delegate(&self) -> Option<&[u8; 32]>
Sourcepub fn delegate_unchecked(&self) -> &[u8; 32]
pub fn delegate_unchecked(&self) -> &[u8; 32]
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
const DISCRIMINATOR: &'static [u8]
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§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more