pub struct TokenExtensionsProgram<'a>(/* private fields */);Expand description
Wrapper for Program for the SPL Token Extensions program.
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> Clone for TokenExtensionsProgram<'a>
impl<'a> Clone for TokenExtensionsProgram<'a>
Source§impl<'a> Deref for TokenExtensionsProgram<'a>
impl<'a> Deref for TokenExtensionsProgram<'a>
impl<'a> Eq for TokenExtensionsProgram<'a>
Source§impl<'a> PartialEq for TokenExtensionsProgram<'a>
impl<'a> PartialEq for TokenExtensionsProgram<'a>
impl<'a> StructuralPartialEq for TokenExtensionsProgram<'a>
Source§impl<'a> TryFrom<&'a NoStdAccountInfo> for TokenExtensionsProgram<'a>
impl<'a> TryFrom<&'a NoStdAccountInfo> for TokenExtensionsProgram<'a>
Source§type Error = SealevelToolsError<'static>
type Error = SealevelToolsError<'static>
Auto Trait Implementations§
impl<'a> !Send for TokenExtensionsProgram<'a>
impl<'a> !Sync for TokenExtensionsProgram<'a>
impl<'a> Freeze for TokenExtensionsProgram<'a>
impl<'a> RefUnwindSafe for TokenExtensionsProgram<'a>
impl<'a> Unpin for TokenExtensionsProgram<'a>
impl<'a> UnsafeUnpin for TokenExtensionsProgram<'a>
impl<'a> UnwindSafe for TokenExtensionsProgram<'a>
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