pub struct Irc27Metadata { /* private fields */ }Expand description
The IRC27 NFT standard schema.
Implementations§
Source§impl Irc27Metadata
impl Irc27Metadata
pub fn version(&self) -> &String
Sourcepub fn media_type(&self) -> &String
pub fn media_type(&self) -> &String
The media type (MIME) of the asset.
§Examples
- Image files:
image/jpeg,image/png,image/gif, etc. - Video files:
video/x-msvideo(avi),video/mp4,video/mpeg, etc. - Audio files:
audio/mpeg,audio/wav, etc. - 3D Assets:
model/obj,model/u3d, etc. - Documents:
application/pdf,text/plain, etc.
Sourcepub fn collection_name(&self) -> &Option<String>
pub fn collection_name(&self) -> &Option<String>
The human-readable collection name of the native token.
Sourcepub fn royalties(&self) -> &BTreeMap<String, f64>
pub fn royalties(&self) -> &BTreeMap<String, f64>
Royalty payment addresses mapped to the payout percentage.
Sourcepub fn issuer_name(&self) -> &Option<String>
pub fn issuer_name(&self) -> &Option<String>
The human-readable name of the native token creator.
Sourcepub fn description(&self) -> &Option<String>
pub fn description(&self) -> &Option<String>
The human-readable description of the token.
Sourcepub fn attributes(&self) -> &BTreeSet<Attribute>
pub fn attributes(&self) -> &BTreeSet<Attribute>
Additional attributes which follow OpenSea Metadata standards.
Source§impl Irc27Metadata
impl Irc27Metadata
pub fn new( media_type: impl Into<String>, uri: impl Into<String>, name: impl Into<String>, ) -> Self
pub fn with_collection_name(self, collection_name: impl Into<String>) -> Self
pub fn add_royalty(self, address: String, percentage: f64) -> Self
pub fn with_royalties(self, royalties: BTreeMap<String, f64>) -> Self
pub fn with_issuer_name(self, issuer_name: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
pub fn add_attribute(self, attribute: Attribute) -> Self
pub fn with_attributes(self, attributes: BTreeSet<Attribute>) -> Self
pub fn to_bytes(&self) -> Vec<u8> ⓘ
Trait Implementations§
Source§impl Clone for Irc27Metadata
impl Clone for Irc27Metadata
Source§fn clone(&self) -> Irc27Metadata
fn clone(&self) -> Irc27Metadata
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Irc27Metadata
impl Debug for Irc27Metadata
Source§impl<'de> Deserialize<'de> for Irc27Metadata
impl<'de> Deserialize<'de> for Irc27Metadata
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<Irc27Metadata> for Vec<u8>
impl From<Irc27Metadata> for Vec<u8>
Source§fn from(value: Irc27Metadata) -> Self
fn from(value: Irc27Metadata) -> Self
Converts to this type from the input type.
Source§impl PartialEq for Irc27Metadata
impl PartialEq for Irc27Metadata
Source§impl Serialize for Irc27Metadata
impl Serialize for Irc27Metadata
Source§impl TryFrom<Irc27Metadata> for MetadataFeature
impl TryFrom<Irc27Metadata> for MetadataFeature
impl StructuralPartialEq for Irc27Metadata
Auto Trait Implementations§
impl Freeze for Irc27Metadata
impl RefUnwindSafe for Irc27Metadata
impl Send for Irc27Metadata
impl Sync for Irc27Metadata
impl Unpin for Irc27Metadata
impl UnwindSafe for Irc27Metadata
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