Crate fyrox_resource

Source
Expand description

Resource management

Re-exports§

pub use fyrox_core as core;

Modules§

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.
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 facilliates 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.
options
Resource import options common traits.
state
A module that handles resource states.
untyped
A module for untyped resources. See UntypedResource docs for more info.

Macros§

embedded_data_source

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.

Constants§

CURVE_RESOURCE_UUID
Type UUID of curve resource. It is defined here to load old versions of resources.
MODEL_RESOURCE_UUID
Type UUID of model resource. It is defined here to load old versions of resources.
SHADER_RESOURCE_UUID
Type UUID of shader resource. It is defined here to load old versions of resources.
SOUND_BUFFER_RESOURCE_UUID
Type UUID of sound buffer resource. It is defined here to load old versions of resources.
TEXTURE_RESOURCE_UUID
Type UUID of texture resource. It is defined here to load old versions of resources.

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.