logo
pub struct Manifest {
    pub entries: Vec<AssetEntry, Global>,
    pub local_base: Option<String>,
    pub remote_base: Option<String>,
}
Expand description

An asset manifest contains all the information needed to load an asset pack. A manifest is usually created with Manifest.fromAssets("directory"), but manifests can also be assembled programmatically.

Fields

entries: Vec<AssetEntry, Global>local_base: Option<String>

A base path on the current domain to load this manifest’s assets from, or None.

remote_base: Option<String>

A base URL on another domain to load this manifest’s assets from, or None. May be used to load assets from a CDN, in browsers that support cross-domain requests. If not supported or unset, will fallback to using localBase.

Implementations

Gets the manifest of a pack in the asset directory, that was processed at build-time. @param packName The folder name in your assets/ directory. @param required When true and this pack was not found, throw an error. Otherwise None is returned.

Tries to find a pack suffixed with the closest available variant of the locale. For example, fromAssetsLocalized(“foo”, “pt-BR”) will first try to load foo_pt-BR, then foo_pt, then just foo. @param packName The folder name in your assets/ directory. @param locale An RFC 4646 language tag, or None to use the system language. @param required When true and this pack was not found, throw an error. Otherwise None is returned.

Returns true if the given named pack was included in the asset directory at build-time.

Adds an asset entry to this manifest. @param name The name of the asset. @param url The URL this asset will be downloaded from. @param bytes The size in bytes. @param format Optionally specified content format, by default infer it from the URL.

Iterates over all the assets defined in this manifest.

Get the full URL to load an asset from. Will prepend localBase or remoteBase depending on cross-domain support.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. 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.

Typed getter

Inspect the context.

Inspect the context.

Inspect the context.

Calls U::from(self).

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

Convert into color

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Sets value as a parameter of 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.