Skip to main content

Crate asset

Crate asset 

Source
Expand description

Resource management

Modules§

builtin
Built-in resource is a resource embedded in the application executable file. It is a very useful mechanism when you need to bundle all game resources and put them in the executable file. See BuiltInResource docs for more info.
constructor
A module for creating resources by their UUIDs. It is used to make resource system type-agnostic yet serializable/deserializable. Type UUID is saved together with resource state and used later on deserialization to create a default instance of corresponding resource.
core
Core data structures and algorithms used throughout Fyrox.
entry
Resource manager timed entry. It holds strong reference for a resource and a simple timer variable. When someone uses a resource, the timer variable is reset to default resource lifetime. Timer gradually decreases its value and once it reaches zero, the entry is deleted. The inner resource might still be in use (have a strong reference to it), the resource data will be deleted once no one uses the resource.
event
Resource event handling.
graph
Resource dependency graph. See ResourceDependencyGraph docs for more info.
io
Provides an interface for IO operations that a resource loader will use, this facilitates things such as loading assets within archive files
loader
Resource loader. It manages resource loading.
manager
Resource manager controls loading and lifetime of resource in the engine. See ResourceManager docs for more info.
metadata
Resource metadata. See ResourceMetadata docs for more info.
options
Resource import options common traits.
registry
Resource registry is a database, that contains UUID -> Path mappings for every external resource used in your game. See ResourceRegistry docs for more info.
state
A module that handles resource states.
untyped
A module for untyped resources. See UntypedResource docs for more info.

Macros§

embedded_data_source
Combines a call of include_bytes with the call of DataSource::new. Prevents you from typing the same path twice.

Structs§

Resource
A resource of particular data type. It is a typed wrapper around UntypedResource which does type checks at runtime. See UntypedResource for more info.
ResourceHeaderGuard
Provides typed access to a resource state.

Traits§

ResourceData
A trait for resource data.
ResourceLoadError
A trait for resource load error.
TypedResourceData
Extension trait for a resource data of a particular type, which adds additional functionality, such as: a way to get default state of the data (Default impl), a way to get data’s type uuid. The trait has automatic implementation for any type that implements ResourceData + Default + TypeUuidProvider traits.

Functions§

collect_used_resources
Collects all resources used by a given entity. Internally, it uses reflection to iterate over each field of every descendant sub-object of the entity. This function could be used to collect all resources used by an object, which could be useful if you’re building a resource dependency analyzer.