#[repr(C)]pub struct Metadata {
pub key: Key,
pub update_authority: Pubkey,
pub mint: Pubkey,
pub data: Data,
pub primary_sale_happened: bool,
pub is_mutable: bool,
pub edition_nonce: Option<u8>,
pub token_standard: Option<TokenStandard>,
pub collection: Option<Collection>,
pub uses: Option<Uses>,
pub collection_details: Option<CollectionDetails>,
pub programmable_config: Option<ProgrammableConfig>,
}Fields§
§key: KeyAccount discriminator.
Address of the update authority.
mint: PubkeyAddress of the mint.
data: DataAsset data.
primary_sale_happened: bool§is_mutable: bool§edition_nonce: Option<u8>nonce for easy calculation of editions, if present
token_standard: Option<TokenStandard>Since we cannot easily change Metadata, we add the new DataV2 fields here at the end.
collection: Option<Collection>Collection
uses: Option<Uses>Uses
collection_details: Option<CollectionDetails>Collection Details
programmable_config: Option<ProgrammableConfig>Programmable Config
Implementations§
Trait Implementations§
Source§impl BorshDeserialize for Metadata
impl BorshDeserialize for Metadata
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, BorshError>
fn deserialize(buf: &mut &[u8]) -> Result<Self, BorshError>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
Source§impl BorshSerialize for Metadatawhere
Key: BorshSerialize,
Pubkey: BorshSerialize,
Data: BorshSerialize,
bool: BorshSerialize,
Option<u8>: BorshSerialize,
Option<TokenStandard>: BorshSerialize,
Option<Collection>: BorshSerialize,
Option<Uses>: BorshSerialize,
Option<CollectionDetails>: BorshSerialize,
Option<ProgrammableConfig>: BorshSerialize,
impl BorshSerialize for Metadatawhere
Key: BorshSerialize,
Pubkey: BorshSerialize,
Data: BorshSerialize,
bool: BorshSerialize,
Option<u8>: BorshSerialize,
Option<TokenStandard>: BorshSerialize,
Option<Collection>: BorshSerialize,
Option<Uses>: BorshSerialize,
Option<CollectionDetails>: BorshSerialize,
Option<ProgrammableConfig>: BorshSerialize,
Source§impl TokenMetadataAccount for Metadata
impl TokenMetadataAccount for Metadata
fn key() -> Key
fn size() -> usize
fn is_correct_account_type( data: &[u8], data_type: Key, data_size: usize, ) -> bool
fn pad_length(buf: &mut Vec<u8>) -> Result<(), MetadataError>
fn safe_deserialize(data: &[u8]) -> Result<Self, BorshError>
fn from_account_info(a: &AccountInfo<'_>) -> Result<Self, ProgramError>
impl Eq for Metadata
impl StructuralPartialEq for Metadata
Auto Trait Implementations§
impl Freeze for Metadata
impl RefUnwindSafe for Metadata
impl Send for Metadata
impl Sync for Metadata
impl Unpin for Metadata
impl UnsafeUnpin for Metadata
impl UnwindSafe for Metadata
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> 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>
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