#[repr(C)]pub struct Asset {
pub discriminator: Discriminator,
pub state: State,
pub standard: Standard,
pub mutable: PodBool,
pub owner: Pubkey,
pub group: PodOption<NullablePubkey>,
pub authority: Pubkey,
pub delegate: PodOption<Delegate>,
pub name: PodStr<nifty_asset_types::::state::asset::Asset::{constant#0}>,
}Expand description
Asset account (header) information.
Fields§
§discriminator: DiscriminatorAccount discriminator.
state: StateState of the asset.
standard: StandardStandard of the asset.
mutable: PodBoolIndicates whether the asset is mutable.
owner: PubkeyCurrent owner (holder) of the asset.
group: PodOption<NullablePubkey>Group of the asset.
This is a reference to the asset that represents the group. When
the asset is not part of a group, the group is represented by
Pubkey::default().
Authority of the asset.
The authority is the account that can update the metadata of the asset. This is typically the creator of the asset.
delegate: PodOption<Delegate>Delegate of the asset.
The delegate is the account that can control the asset on behalf of the owner.
name: PodStr<nifty_asset_types::::state::asset::Asset::{constant#0}>Name of the asset.
Implementations§
Source§impl Asset
impl Asset
Sourcepub fn contains(extension_type: ExtensionType, data: &[u8]) -> bool
pub fn contains(extension_type: ExtensionType, data: &[u8]) -> bool
Indicates whether the account contains an extension of a given type.
Sourcepub fn get<'a, T>(data: &'a [u8]) -> Option<T>where
T: ExtensionData<'a>,
pub fn get<'a, T>(data: &'a [u8]) -> Option<T>where
T: ExtensionData<'a>,
Returns the extension data of a given type.
This function will return the first extension of the given type. If the
extension is not found, None is returned.
Sourcepub fn get_mut<'a, T>(data: &'a mut [u8]) -> Option<T>where
T: ExtensionDataMut<'a>,
pub fn get_mut<'a, T>(data: &'a mut [u8]) -> Option<T>where
T: ExtensionDataMut<'a>,
Returns a mutable reference to the extension data of a given type.
This function will return the first extension of the given type. If the
extension is not found, None is returned.
Sourcepub fn get_extensions(data: &[u8]) -> Vec<ExtensionType>
pub fn get_extensions(data: &[u8]) -> Vec<ExtensionType>
Returns the extensions on the account data.
This function will return a list of ExtensionTypes that are present
on the account data.
The account data might have extensions that are not recognized if an older version of the library is used. In this case, this method will only return the list of recognized extensions.
Sourcepub fn first_extension(data: &[u8]) -> Option<(&Extension, usize)>
pub fn first_extension(data: &[u8]) -> Option<(&Extension, usize)>
Returns the first extension of the account.
This function will return a tuple containing the extension type and the
offset of the extension data. If the account does not contain any extension,
None is returned.
Sourcepub fn last_extension(data: &[u8]) -> Option<(&Extension, usize)>
pub fn last_extension(data: &[u8]) -> Option<(&Extension, usize)>
Returns the last extension of the account.
This function will return a tuple containing the extension type and the
offset of the extension data. If the account does not contain any extension or
if it contains an unrecognized extension type, None is returned.
Sourcepub fn get_extension(
extension_type: ExtensionType,
data: &[u8],
) -> Option<(&Extension, usize)>
pub fn get_extension( extension_type: ExtensionType, data: &[u8], ) -> Option<(&Extension, usize)>
Returns the extension given its type.
This function will return a tuple containing the extension type and the
offset to the extension data. If the account does not contain any extension,
None is returned.
Trait Implementations§
impl Copy for Asset
impl Pod for Asset
Auto Trait Implementations§
impl Freeze for Asset
impl RefUnwindSafe for Asset
impl Send for Asset
impl Sync for Asset
impl Unpin for Asset
impl UnsafeUnpin for Asset
impl UnwindSafe for Asset
Blanket Implementations§
impl<T> AnyBitPattern for Twhere
T: Pod,
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> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self.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