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
BuiltInResourcedocs 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
ResourceDependencyGraphdocs 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
ResourceManagerdocs for more info. - metadata
- Resource metadata. See
ResourceMetadatadocs for more info. - options
- Resource import options common traits.
- registry
- Resource registry is a database, that contains
UUID -> Pathmappings for every external resource used in your game. SeeResourceRegistrydocs for more info. - state
- A module that handles resource states.
- untyped
- A module for untyped resources. See
UntypedResourcedocs for more info.
Macros§
- embedded_
data_ source - Combines a call of
include_byteswith the call ofDataSource::new. Prevents you from typing the same path twice.
Structs§
- Resource
- A resource of particular data type. It is a typed wrapper around
UntypedResourcewhich does type checks at runtime. SeeUntypedResourcefor more info. - Resource
Header Guard - Provides typed access to a resource state.
Traits§
- Resource
Data - A trait for resource data.
- Resource
Load Error - A trait for resource load error.
- Typed
Resource Data - 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 (
Defaultimpl), a way to get data’s type uuid. The trait has automatic implementation for any type that implementsResourceData + Default + TypeUuidProvidertraits.
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.