pub struct LocalJson { /* private fields */ }
Expand description

A MetadataGenerator that consults stored JSON files in the local filesystem.

Notes

Files must be stored at contract.json for contract-level metadata, and {token-id}.json for tokens, where token-id is the string representation of the decimal token id. e.g. 0.json, 384510.json, etc

This generator caches files in memory the first time they’re opened. If NFT metadata changes, the server will need to be re-booted to clear the cache. In addition, if you’re serving an egregious number of NFTs (or have large image-data properties), you may run out of memory as the cache grows

Implementations

Instantiate a LocalJson metadata generator. Creates directories up to the specified path

Errors
  • If the location exists and is not a directory
  • If the directory can’t be created

Trait Implementations

Formats the value using the given formatter. Read more
Associated Error type
Generate metadata for a specific token
Generate contract-level metadata (in the OpenSea format). See ContractMetadata. Read more

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.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

Should always be Self
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.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more