pub struct ZTokenMut<'a> {
pub base: ZTokenZeroCopyMetaMut<'a>,
pub extensions: Option<Vec<ZExtensionStructMut<'a>>>,
/* private fields */
}Expand description
Mutable zero-copy view of Token with base and optional extensions
Fields§
§base: ZTokenZeroCopyMetaMut<'a>§extensions: Option<Vec<ZExtensionStructMut<'a>>>Implementations§
Source§impl<'a> ZTokenMut<'a>
impl<'a> ZTokenMut<'a>
Sourcepub fn account_type(&self) -> u8
pub fn account_type(&self) -> u8
Returns the account_type byte read from position 165
Sourcepub fn is_token_account(&self) -> bool
pub fn is_token_account(&self) -> bool
Checks if account_type matches Token discriminator value
Sourcepub fn get_compressible_extension_mut(
&mut self,
) -> Option<&mut ZCompressibleExtensionMut<'a>>
pub fn get_compressible_extension_mut( &mut self, ) -> Option<&mut ZCompressibleExtensionMut<'a>>
Returns a mutable reference to the Compressible extension if it exists
Sourcepub fn get_compressible_extension(
&self,
) -> Option<&ZCompressibleExtensionMut<'a>>
pub fn get_compressible_extension( &self, ) -> Option<&ZCompressibleExtensionMut<'a>>
Returns an immutable reference to the Compressible extension if it exists
Methods from Deref<Target = ZTokenZeroCopyMetaMut<'a>>§
Sourcepub fn is_uninitialized(&self) -> bool
pub fn is_uninitialized(&self) -> bool
Checks if account is uninitialized (state == 0)
Sourcepub fn is_initialized(&self) -> bool
pub fn is_initialized(&self) -> bool
Checks if account is initialized (state == 1)
Sourcepub fn is_native_value(&self) -> Option<u64>
pub fn is_native_value(&self) -> Option<u64>
Get is_native value if set (COption discriminator == 1)
Get close_authority if set (COption discriminator == 1)
Sourcepub fn set_delegate(
&mut self,
delegate: Option<Pubkey>,
) -> Result<(), TokenError>
pub fn set_delegate( &mut self, delegate: Option<Pubkey>, ) -> Result<(), TokenError>
Set delegate (Some to set, None to clear)
Sourcepub fn set_frozen(&mut self)
pub fn set_frozen(&mut self)
Set account as frozen (state = 2)
Sourcepub fn set_initialized(&mut self)
pub fn set_initialized(&mut self)
Set account as initialized/unfrozen (state = 1)
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ZTokenMut<'a>
impl<'a> RefUnwindSafe for ZTokenMut<'a>
impl<'a> Send for ZTokenMut<'a>
impl<'a> Sync for ZTokenMut<'a>
impl<'a> Unpin for ZTokenMut<'a>
impl<'a> !UnwindSafe for ZTokenMut<'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
Mutably borrows from an owned value. Read more
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>
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 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>
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