Skip to main content

TokenExtensionsProgramAccount

Struct TokenExtensionsProgramAccount 

Source
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>>§

Source

pub fn try_close(&self, beneficiary: &Account<'a, true>) -> ProgramResult

Source

pub fn as_cpi_authority<'a>( &'b self, signer_seeds: Option<&'a [&'b [u8]]>, ) -> CpiAuthority<'a, 'b>
where 'b: 'a,

Methods from Deref<Target = NoStdAccountInfo>§

Source

pub fn to_info_c(&self) -> AccountInfoC

CPI utility function

Source

pub fn to_meta_c(&self) -> AccountMetaC

CPI utility function

Source

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.

Source

pub fn key(&self) -> &Pubkey

Source

pub fn owner(&self) -> &Pubkey

Source

pub fn is_signer(&self) -> bool

Source

pub fn is_writable(&self) -> bool

Source

pub fn executable(&self) -> bool

Source

pub fn data_len(&self) -> usize

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn reassign(&self, new_owner: &Pubkey)

Trait Implementations§

Source§

impl<'a, const WRITE: bool> Clone for TokenExtensionsProgramAccount<'a, WRITE>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a, const WRITE: bool> Deref for TokenExtensionsProgramAccount<'a, WRITE>

Source§

type Target = Account<'a, WRITE>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<'a, const WRITE: bool> Eq for TokenExtensionsProgramAccount<'a, WRITE>

Source§

impl<'a, const WRITE: bool> PartialEq for TokenExtensionsProgramAccount<'a, WRITE>

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<'a, const WRITE: bool> StructuralPartialEq for TokenExtensionsProgramAccount<'a, WRITE>

Source§

impl<'a, const WRITE: bool> TryFrom<&'a NoStdAccountInfo> for TokenExtensionsProgramAccount<'a, WRITE>

Source§

type Error = SealevelToolsError<'static>

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

fn try_from(account: &'a NoStdAccountInfo) -> Result<Self, Self::Error>

Performs the conversion.

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>
where Account<'a, WRITE>: Freeze,

§

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>
where Account<'a, WRITE>: Unpin,

§

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> 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V