[][src]Crate amethyst_assets

amethyst_assets

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

  • extensibility
  • asynchronous & parallel using rayon
  • allow different sources

Structs

AssetLoaderSystemData

Helper type for loading assets

AssetStorage

An asset storage, storing the actual assets and allocating handles to them.

Cache

A simple cache for asset handles of type A. This stores WeakHandle, so it doesn't keep the assets alive.

Directory

Directory source.

Error

The Error type.

FormatValue

The Ok return value of Format::import for a given asset type A.

Handle

A handle to an asset. This is usually what the user deals with, the actual asset (A) is stored in an AssetStorage.

HotReloadBundle

This bundle activates hot reload for the Loader, adds a HotReloadStrategy and the HotReloadSystem.

HotReloadStrategy

An ECS resource which allows to configure hot reloading.

HotReloadSystem

System for updating HotReloadStrategy.

Loader

The asset loader, holding the sources and a reference to the ThreadPool.

Prefab

Main Prefab structure, containing all data loaded in a single prefab.

PrefabLoader

Helper structure for loading prefabs.

PrefabLoaderSystem

System that load Prefabs for PrefabData T.

Processor

A default implementation for an asset processing system which converts data to assets and maintains the asset storage for A.

ProgressCounter

A progress tracker which is passed to the Loader in order to check how many assets are loaded.

RonFormat

Format for loading from Ron files.

SingleFile

An implementation of Reload which just stores the modification time and the path of the file.

WeakHandle

A weak handle, which is useful if you don't directly need the asset like in caches. This way, the asset can still get dropped (if you want that).

Enums

AssetPrefab

Convenience PrefabData for loading assets of type A using Format F.

Completion

Completion status, returned by ProgressCounter::complete.

ErrorKind

The kind of an error.

PrefabError

The Specs error type. This is an enum which is able to represent all error types of this library.

ProcessingState

Returned by processor systems, describes the loading state of the asset.

Traits

Asset

One of the three core traits of this crate.

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.

PrefabData

Trait for loading a prefabs data for a single entity

Progress

The Progress trait, allowing to track which assets are imported already.

Reload

The Reload trait provides a method which checks if an asset needs to be reloaded.

ResultExt

Additional methods for Result, for easy interaction with this crate.

SimpleFormat

This is a simplified version of Format, which doesn't give you as much freedom, but in return is simpler to implement. All SimpleFormat types automatically implement Format. This format assumes that the asset name is the full path and the asset is only contained in one file.

Source

A trait for asset sources, which provides methods for loading bytes.

Tracker

The Tracker trait which will be used by the loader to report back to Progress.

Type Definitions

Result

Convenient wrapper around std::Result.