pub struct TokenExtensionsProgramAccount<'a, const WRITE: bool>(/* private fields */);Expand description
Account must be owned by the SPL Token Extensions program.
Methods from Deref<Target = Account<'a, WRITE>>§
pub fn try_close(&self, beneficiary: &Account<'a, true>) -> ProgramResult
Methods from Deref<Target = NoStdAccountInfo>§
Sourcepub fn to_info_c(&self) -> AccountInfoC
pub fn to_info_c(&self) -> AccountInfoC
CPI utility function
Sourcepub fn to_meta_c(&self) -> AccountMetaC
pub fn to_meta_c(&self) -> AccountMetaC
CPI utility function
Sourcepub fn to_meta_c_signer(&self) -> AccountMetaC
pub fn to_meta_c_signer(&self) -> AccountMetaC
CPI utility function.
Intended for pdas that did not sign transaction but need to sign for cpi.
pub fn key(&self) -> &Pubkey
pub fn owner(&self) -> &Pubkey
pub fn is_signer(&self) -> bool
pub fn is_writable(&self) -> bool
pub fn executable(&self) -> bool
pub fn data_len(&self) -> usize
Sourcepub unsafe fn unchecked_borrow_lamports(&self) -> &u64
pub unsafe fn unchecked_borrow_lamports(&self) -> &u64
§Safety
This does not check or modify the 4-bit refcell. Useful when instruction has verified non-duplicate accounts.
Sourcepub unsafe fn unchecked_borrow_mut_lamports(&self) -> &mut u64
pub unsafe fn unchecked_borrow_mut_lamports(&self) -> &mut u64
§Safety
This does not check or modify the 4-bit refcell. Useful when instruction has verified non-duplicate accounts.
Sourcepub unsafe fn unchecked_borrow_data(&self) -> &[u8] ⓘ
pub unsafe fn unchecked_borrow_data(&self) -> &[u8] ⓘ
§Safety
This does not check or modify the 4-bit refcell. Useful when instruction has verified non-duplicate accounts.
Sourcepub unsafe fn unchecked_borrow_mut_data(&self) -> &mut [u8] ⓘ
pub unsafe fn unchecked_borrow_mut_data(&self) -> &mut [u8] ⓘ
§Safety
This does not check or modify the 4-bit refcell. Useful when instruction has verified non-duplicate accounts.
Sourcepub fn try_borrow_lamports(&self) -> Result<Ref<'_, u64>, ProgramError>
pub fn try_borrow_lamports(&self) -> Result<Ref<'_, u64>, ProgramError>
Tries to get a read only reference to the lamport field, failing if the field is already mutable borrowed or if 7 borrows already exist.
Sourcepub fn try_borrow_mut_lamports(&self) -> Result<RefMut<'_, u64>, ProgramError>
pub fn try_borrow_mut_lamports(&self) -> Result<RefMut<'_, u64>, ProgramError>
Tries to get a read only reference to the lamport field, failing if the field is already borrowed in any form.
Sourcepub fn try_borrow_data(&self) -> Result<Ref<'_, [u8]>, ProgramError>
pub fn try_borrow_data(&self) -> Result<Ref<'_, [u8]>, ProgramError>
Tries to get a read only reference to the data field, failing if the field is already mutable borrowed or if 7 borrows already exist.
Sourcepub fn try_borrow_mut_data(&self) -> Result<RefMut<'_, [u8]>, ProgramError>
pub fn try_borrow_mut_data(&self) -> Result<RefMut<'_, [u8]>, ProgramError>
Tries to get a read only reference to the data field, failing if the field is already borrowed in any form.
Sourcepub fn realloc(
&self,
new_len: usize,
zero_init: bool,
) -> Result<(), ProgramError>
pub fn realloc( &self, new_len: usize, zero_init: bool, ) -> Result<(), ProgramError>
Realloc the account’s data and optionally zero-initialize the new memory.
Note: Account data can be increased within a single call by up to
solana_program::entrypoint::MAX_PERMITTED_DATA_INCREASE bytes.
Note: Memory used to grow is already zero-initialized upon program
entrypoint and re-zeroing it wastes compute units. If within the same
call a program reallocs from larger to smaller and back to larger again
the new space could contain stale data. Pass true for zero_init in
this case, otherwise compute units will be wasted re-zero-initializing.
§Safety
This method makes assumptions about the layout and location of memory
referenced by AccountInfo fields. It should only be called for
instances of AccountInfo that were created by the runtime and received
in the process_instruction entrypoint of a program.
pub fn reassign(&self, new_owner: &Pubkey)
Trait Implementations§
Source§impl<'a, const WRITE: bool> Clone for TokenExtensionsProgramAccount<'a, WRITE>
impl<'a, const WRITE: bool> Clone for TokenExtensionsProgramAccount<'a, WRITE>
Source§impl<'a, const WRITE: bool> Deref for TokenExtensionsProgramAccount<'a, WRITE>
impl<'a, const WRITE: bool> Deref for TokenExtensionsProgramAccount<'a, WRITE>
impl<'a, const WRITE: bool> Eq for TokenExtensionsProgramAccount<'a, WRITE>
Source§impl<'a, const WRITE: bool> PartialEq for TokenExtensionsProgramAccount<'a, WRITE>
impl<'a, const WRITE: bool> PartialEq for TokenExtensionsProgramAccount<'a, WRITE>
impl<'a, const WRITE: bool> StructuralPartialEq for TokenExtensionsProgramAccount<'a, WRITE>
Source§impl<'a, const WRITE: bool> TryFrom<&'a NoStdAccountInfo> for TokenExtensionsProgramAccount<'a, WRITE>
impl<'a, const WRITE: bool> TryFrom<&'a NoStdAccountInfo> for TokenExtensionsProgramAccount<'a, WRITE>
Source§type Error = SealevelToolsError<'static>
type Error = SealevelToolsError<'static>
Auto Trait Implementations§
impl<'a, const WRITE: bool> !Send for TokenExtensionsProgramAccount<'a, WRITE>
impl<'a, const WRITE: bool> !Sync for TokenExtensionsProgramAccount<'a, WRITE>
impl<'a, const WRITE: bool> Freeze for TokenExtensionsProgramAccount<'a, WRITE>
impl<'a, const WRITE: bool> RefUnwindSafe for TokenExtensionsProgramAccount<'a, WRITE>where
Account<'a, WRITE>: RefUnwindSafe,
impl<'a, const WRITE: bool> Unpin for TokenExtensionsProgramAccount<'a, WRITE>
impl<'a, const WRITE: bool> UnsafeUnpin for TokenExtensionsProgramAccount<'a, WRITE>where
Account<'a, WRITE>: UnsafeUnpin,
impl<'a, const WRITE: bool> UnwindSafe for TokenExtensionsProgramAccount<'a, WRITE>where
Account<'a, WRITE>: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more