Crate amethyst_assets [] [src]

amethyst_assets

Asset management crate. Designed with the following goals in mind:

  • extensibility
  • asynchronous & parallel using rayon and futures
  • allow different stores

Structs

AssetError

Error type returned when loading an asset. Includes the AssetSpec and the error (LoadError).

AssetFuture

A future for an asset

AssetPtr

An AssetPtr which provides push_update, update and is_shared methods. These can simply be called in order to implement the Asset trait.

AssetSpec

A specifier for an asset, uniquely identifying it by

BoxedErr

A boxed error implementing Debug, Display and Error.

Cache

A basic implementation for a cache. This might be useful as the Context of an Asset, so that the same asset doesn't get imported twice.

Directory

Directory store.

Loader

The asset loader, holding the contexts, the default (directory) store and a reference to the ThreadPool.

SharedAssetError

Shared version of error

SimpleAsset

Asset implementation that supports hot reloading

SimpleContext

A simple implementation of the Context trait.

SpawnedFuture

Represents a future value of an asset. This future may be added to the ECS world, where the responsible system can poll it and merge it into the persistent storage once it is Ready.

StoreId

A unique store id, used to identify the storage in AssetSpec.

Enums

LoadError

Combined error type which is produced when loading an asset. This error does not include information which asset failed to load. For that, please look at AssetError.

NoError

An error type which cannot be instantiated. Used as a placeholder for associated error types if something cannot fail.

Traits

Asset

One of the three core traits of this crate.

Context

The context type which manages assets of one type. It is responsible for caching

Format

A format, providing a conversion from bytes to asset data, which is then in turn accepted by Asset::from_data. Examples for formats are Png, Obj and Wave.

Store

A trait for asset stores, which provides methods for loading

Functions

load_asset

Loads an asset with a given context, format, specifier and storage right now.