pub struct ZToken<'a> {
pub base: ZTokenZeroCopyMeta<'a>,
pub extensions: Option<Vec<ZExtensionStruct<'a>>>,
/* private fields */
}Expand description
Zero-copy view of Token with base and optional extensions
Fields§
§base: ZTokenZeroCopyMeta<'a>§extensions: Option<Vec<ZExtensionStruct<'a>>>Implementations§
Source§impl<'a> ZToken<'a>
impl<'a> ZToken<'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(&self) -> Option<&ZCompressibleExtension<'a>>
pub fn get_compressible_extension(&self) -> Option<&ZCompressibleExtension<'a>>
Returns a reference to the Compressible extension if it exists
Methods from Deref<Target = ZTokenZeroCopyMeta<'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)
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ZToken<'a>
impl<'a> RefUnwindSafe for ZToken<'a>
impl<'a> Send for ZToken<'a>
impl<'a> Sync for ZToken<'a>
impl<'a> Unpin for ZToken<'a>
impl<'a> UnwindSafe for ZToken<'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