pub struct Metadata {
    pub image: Url,
    pub external_url: Option<Url>,
    pub description: String,
    pub name: String,
    pub attributes: Vec<AttributeEntry>,
    pub background_color: Option<RGB8>,
    pub animation_url: Option<Url>,
    pub youtube_url: Option<Url>,
}
Expand description

Metadata for a token.

While even an empty object is “valid” metadata, this crate takes a more opinionated approach. The following fields are strictly required: name, description, image.

Fields

image: Url

URL to image of the item.

external_url: Option<Url>

External URL to another site.

description: String

Human-readable description of the item.

name: String

Name of the item.

attributes: Vec<AttributeEntry>

Attributes for the item.

background_color: Option<RGB8>

Background color of the item. When serialized, it takes the form of a 6-character hexadecimal string without a #.

animation_url: Option<Url>

URL to multi-media attachment for the item.

youtube_url: Option<Url>

URL to a YouTube video.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.