Module bones_framework::prelude
source · Expand description
The prelude.
Re-exports§
pub use crate::AssetServerExt;
pub use crate::DefaultGamePlugin;
pub use crate::DefaultSessionPlugin;
pub use crate::ExitBones;
pub use crate::debug;
pub use crate::animation::*;
pub use crate::input::prelude::*;
pub use crate::params::*;
pub use crate::render::prelude::*;
pub use crate::storage::*;
pub use crate::time::*;
pub use crate::utils::*;
pub use crate::networking::prelude::*;
pub use crate::localization::*;
pub use crate::logging::prelude::*;
Modules§
- Simple reflection system based on the
#[repr(C)]
memory layout. - General utilities for Bones meta-engine crates.
bool
vector mask types.- This module contains types that can be used to implement atomic borrowing.
f32
vector, quaternion and matrix types.f64
vector, quaternion and matrix types.i32
vector types.i64
vector types.- Traits adding swizzle methods to all vector types.
u32
vector types.u64
vector types.
Macros§
- Shorthand for combining bitsets with bit_or.
- Shorthand for setting bits on the bitset container.
- Implements the
BitSet
trait members for your type throughDerefMut
.
Structs§
- A 2D affine transform, which can represent translation, rotation, scaling and shear.
- A 3D affine transform, which can represent translation, rotation, scaling and shear.
- Helper type for storing asset extensions.
- An identifier for an asset.
- Context provided to custom asset loaders in the
AssetLoader::load
method. - The progress that has been made loading the game assets.
- Contains that path to an asset, and the pack_dir that it was loaded from.
- A borrowed version of
AssetLoc
. - An asset pack contains assets that are loaded by the game.
- A requirement specifier for an asset pack, made up of the asset pack’s
LabeledId
and it’sVersionReq
. - Specifies an asset pack, and it’s exact version.
- Struct responsible for loading assets into it’s contained
AssetStore
, using anAssetIo
implementation. - The inner state of the asset server.
- Stores assets for later retrieval.
- A mutable memory location with dynamically checked borrow rules This type behaves mostly like
core::cell::RefCell
. The main difference is that this type uses atomic operations for borrowing. Thus allowing to use it in multi-threaded environment. - A handle to a resource from a
Resources
collection. - A 2-dimensional
bool
vector mask. - A 3-dimensional
bool
vector mask. - A 4-dimensional
bool
vector mask. - A 3-dimensional SIMD vector mask.
- A 4-dimensional SIMD vector mask.
- BitSet formatter.
- The type of bitsets used to track entities in component storages. Mostly used to create caches.
- Error thrown when a resource cell cannot be inserted because it already exists.
- A unique content ID.
- A resource containing the
Commands
command queue. - A
SystemParam
that can be used to schedule systems that will be run at the end of the currentSystemStage
. - A typed wrapper around
UntypedComponentStore
. - A collection of
ComponentStore<T>
. - YAML format for the core asset pack’s
pack.yaml
file. - Resource that is automatically added to the world while a system stage is being run that specifies the unique ID of the stage that being run.
- A 2D affine transform, which can represent translation, rotation, scaling and shear.
- A 3D affine transform, which can represent translation, rotation, scaling and shear.
- A 2x2 column major matrix.
- A 3x3 column major matrix.
- A 4x4 column major matrix.
- A quaternion representing an orientation.
- A 2-dimensional vector.
- A 3-dimensional vector.
- A 4-dimensional vector.
- Dummy
AssetIo
implementation used for debugging or as a placeholder. - Holds a list of alive entities.
- Iterator over entities returned by
Entities::iter_with
. - An entity index.
- Iterator over entities using the provided bitset.
- Helper for accessing the inner data of a schema ref at runtime.
- Helper for accessing the inner data of a schema ref at runtime.
- Schema data for an enum.
- A wrapper type that implements [
IntoIterator<Item = FieldIdx>
] for an inner string to make it easier to use withSchemaRefAccess::field_path()
and other field path methods. AssetIo
implementation that loads from the filesystem.- The
Game
encompasses a complete bones game’s logic, independent of the renderer and IO implementations. - A typed handle to an asset.
- A 2-dimensional vector.
- A 3-dimensional vector.
- A 4-dimensional vector.
- A 2-dimensional vector.
- A 3-dimensional vector.
- A 4-dimensional vector.
- The system input parameter.
- An error returned when an asset pack does not support the game version.
- A
Ulid
with a human-readable ascii prefix. - An asset that has been loaded.
- Struct containing all the game’s loaded assets, including the default assets and asset-packs/mods.
- Resource used to access the lua scripting engine.
- A lua plugin asset.
- A `SessionPlugin that will run the provided lua plugins
- The systems that have been registered by a lua plugin.
- Resource containing the lua plugins that have been installed in this session.
- A Lua script asset.
- Struct for accessing and initializing lua singletons.
- A 2x2 column major matrix.
- A 3x3 column major matrix.
- A 4x4 column major matrix.
- A 3x3 column major matrix.
- Context provided while loading a metadata asset.
- Asset handle that may be replicated over network and converted back into
Handle
orUntypedHandle
. - Wrapper for the
Comp
SystemParam
used asQueryItem
to iterate over entities optionally retrieving components fromComponentStore
. Entities iterated over will not be filtered byOptionalQueryItem
. - Wrapper for the
CompMut
SystemParam
used asQueryItem
to iterate over entities optionally and mutably retrieving components fromComponentStore
. Entities iterated over will not be filtered byOptionalQueryItemMut
. - YAML format for asset packs’
pack.yaml
file. - A quaternion representing an orientation.
- Wrapper for a borrowed
AtomicCell
that will released lock on drop. - Wrapper for mutably borrowed
AtomicCell
that will released lock on drop. SystemParam
for getting read access to a resource.SystemParam
for getting read access to a resource and initialzing it if it doesn’t already exist.SystemParam
for getting mutable access to a resource.SystemParam
for getting mutable access to a resource and initializing it if it doesn’t already exist.- A collection of resources.
- A typed version of
SchemaBox
. - Typed version of a
SchemaMap
. - A typed version of a
SchemaVec
. - Type data for asset handles.
- A owning, type-erased
Box
-like container for types with a [Schema
]. - Schema information describing the memory layout of a type.
- Derivable schema
type_data
for types that implementDeserialize
. - A struct that implements
DeserializeSeed
and can be used to deserialize values matching a given [Schema
]. - Error returned when a field is not found in a schema.
- A unique identifier for a schema registered in the
SCHEMA_REGISTRY
. - Layout information computed for
SchemaData
. - Untyped schema-aware “HashMap”.
- Access helper for a
SchemaMap
. - Mutable
SchemaMap
access helper. - A custom asset loader implementation for a metadata asset.
- Error type when attempting to cast between types with mis-matched schemas.
- A schema reference, containing the ID of the pack that defined the schema, and the name of the schema in the pack.
- The load context for a
SchemaRefMut
. - An untyped reference that knows the [
Schema
] of the pointee and that can be cast to a matching type. - An untyped mutable reference that knows the [
Schema
] of the pointee and that can be cast to a matching type. - A schema registry that alloates
SchemaId
s forSchemaData
s and returns a registered [&'static Schema
][Schema]. - A type-erased
Vec
-like collection that for items with the same [Schema
]. - Access helper for a
SchemaVec
. - Mutable
SchemaVec
access helper. - Scripting plugin for the bones framework.
- A bones game. This includes all of the game worlds, and systems.
- Resource that allows you to configure the current session.
- Container for multiple game sessions.
- A collection of systems that will be run in order.
- Struct containing a static system.
- A field in a
StructSchemaInfo
. - Helper for accessing the inner data of a schema ref at runtime.
- Iterator for
StructRefAccess::fields()
. - A field returned by
StructRefFieldIter
. - Helper for accessing the inner data of a schema ref at runtime.
- Iterator for
StructRefAccess::fields()
. - A field returned by
StructRefFieldIter
. - Schema data for a struct.
- An ordered collection of
SystemStage
s. - A clock that tracks how much it has advanced (and how much real time has elapsed) since its previous update and since its creation.
- A 2-dimensional vector.
- A 3-dimensional vector.
- A 4-dimensional vector.
- A 2-dimensional vector.
- A 3-dimensional vector.
- A 4-dimensional vector.
- A Ulid is a unique 128-bit lexicographically sortable identifier
- A wrapper struct that marks it unsafe to both create and access the inner value.
- Iterates over components using a provided bitset. Each time the bitset has a 1 in index i, the iterator will fetch data from the storage at index i and return it.
- Iterates over components using a provided bitset. Each time the bitset has a 1 in index i, the iterator will fetch data from the storage at index i.
- Iterate over component store returning
Option<SchemaRef<'a>>
, filtered by bitset of iterator, but not bitset of own ComponentStore. Returns None on bitset entries that do not have this Component. - Iterate mutably over component store returning
Option<SchemaRef<'a>>
, filtered by bitset of iterator, but not bitset of own ComponentStore. Returns None on bitset entries that do not have this Component. - Holds components of a given type indexed by
Entity
. - Mutable iterator over pointers in an untyped component store.
- Mutable iterator over pointers in an untyped component store.
- An untyped handle to an asset.
- An untyped resource that may be inserted into
UntypedResources
. - Storage for un-typed resources.
- A handle representing a string in the global string cache.
- Information about an enum variant for
EnumSchemaInfo
. - A 2-dimensional vector.
- A 3-dimensional vector.
- A 4-dimensional vector.
- A 3-dimensional vector.
- SemVer version as defined by https://semver.org.
- Asset IO implementation that loads assets from a URL.
- A frozen reference to the ECS
World
.
Enums§
- A type data that indicates how to load a type as an asset.
- An ID for an asset that has changed.
- A
StageLabel
for the 5 core stages. - A type for an enum tag for
EnumSchemaInfo
. - Euler rotation sequences.
- The index of a field in a struct in a [
Schema
]. - Error creating a
LabeledId
. - Errors that can happen while parsing a
LabeledId
. - The load state of the [`LuaPluginSystems
- A type of primitive.
- Helper for accessing the inner data of a schema ref at runtime.
- Helper for accessing the inner data of a schema ref at runtime.
- An error that may occur when querying for a single entity. For example, via
Entities::get_single_with
, or more directly withComponentStore::get_single_with_bitset
orComponentStore::get_single_mut_with_bitset
. - A schema describes the data layout of a type, to enable dynamic access to the type’s data through a pointer.
- Helper for accessing the inner data of a schema ref at runtime.
- Access a schema
Constants§
- A fast, non-cryptographic, thread-local random number generator powered by turborand.
Statics§
- The
AssetPackId
of the core pack.
Traits§
- Let
Path
andPathBuf
haveabsolutize
andabsolutize_virtually
method. AssetIo
is a trait that is implemented for backends capable of loading all the games assets and returning the raw bytes stored in asset files.- A custom assset loader.
- The BitSet API.
- This trait factors out functions for iterating with bitset over component store. Separated from
impl ComponentStore
for usage in generic trait types that must be able to createComponentBitsetIterator
and related types. - Provides the
context
method forResult
. - Extension trait for the
Context
that makes it easier to access our lua singletons. - A data structure that can be deserialized from any data format supported by Serde.
- Trait implemented for types that can produce an instance of themselves from a Rust type.
- Creates an instance of the type this trait is implemented for using data from the supplied
World
. - Trait for plugins that can be installed into a
Game
. - This trait provides the means to easily generate all integer types, provided the main method underpinning this is implemented:
GenCore::gen
. Once implemented, the rest of the trait provides default implementations for generating all integer types, though it is not recommended to override these. - Trait implemented for types that have a [
Schema
]. - Converts a function into a
System
. - Helper trait to get a singleton fn pointer for the metatable for a type.
- A type representing a component-joining entity query.
- A data structure that can be serialized into any data format supported by Serde.
- Trait for plugins that can be installed into a
Session
. - A session runner is in charge of advancing a
Session
simulation. - Trait for things that may be used to identify a system stage.
- Trait implemented by systems.
- Trait used to implement parameters for
System
functions. - Trait for system stages. A stage is a
- Extension trait for automatically implementing all
TurboRand
methods, as long as the struct implements [TurboCore
] &GenCore
. All methods are provided as default implementations that build on top of [TurboCore
] andGenCore
, and thus are not recommended to be overridden, lest you potentially change the expected outcome of the methods. - Extension trait for
Ulid
. - Helper trait for unwraping each item in an array.
- Extension trait on top of
Value
to add helper functions.
Functions§
- Helper func to construct a
OptionalQueryItem
wrapping aComp
SystemParam
. Used to iterate over enities optionally retrieving components fromComponentStore
. Entities iterated over will not be filtered by thisQueryItem
. - Helper func to construct a
OptionalQueryItemMut
wrapping aCompMut
SystemParam
. Used to iterate over enities optionally and mutably retrieving components fromComponentStore
. Entities iterated over will not be filtered by thisQueryItem
. - Helper function to return type data for a custom asset loader.
- Creates a bitset big enough to contain the index of each entity. Mostly used to create caches.
- An ergonomic abbreviation for
Default::default()
to make initializing structs easier. This is especially helpful when combined with “struct update syntax”. - Creates a 2x2 matrix from two column vectors.
- Creates a 3x3 matrix from three column vectors.
- Creates a 4x4 matrix from four column vectors.
- Creates a quaternion from
x
,y
,z
andw
values. - Creates a 2-dimensional vector.
- Creates a 3-dimensional vector.
- Creates a 4-dimensional vector.
- Shortens a type name to remove all module paths.
- Creates a 2-dimensional vector.
- Creates a 3-dimensional vector.
- Creates a 4-dimensional vector.
- Creates a 2-dimensional vector.
- Creates a 3-dimensional vector.
- Creates a 4-dimensional vector.
- Hints to the compiler that the branch condition is likely to be true. Returns the value passed to it.
- Install the lua scripting plugin.
- Creates a 2x2 matrix from two column vectors.
- Creates a 3x3 matrix from three column vectors.
- Creates a 4x4 matrix from four column vectors.
- Creates a 3x3 matrix from three column vectors.
- Helper function to return type data for a metadata asset.
- Creates a quaternion from
x
,y
,z
andw
values. - Creates a 2-dimensional vector.
- Creates a 3-dimensional vector.
- Creates a 4-dimensional vector.
- Hints to the compiler that the branch condition is unlikely to be true. Returns the value passed to it.
- Create a new Ustr from the given &str.
- Creates a 2-dimensional vector.
- Creates a 3-dimensional vector.
- Creates a 4-dimensional vector.
- Creates a 2-dimensional vector.
- Creates a 3-dimensional vector.
- Creates a 4-dimensional vector.
- Creates a 3-dimensional vector.
Type Aliases§
- The unique ID for an asset pack.
- An atomic component store.
- An untyped, atomic resource cell.
- Type alias for
Pin<Box<dyn Future<Output = T> + Send + 'static>>
. SystemParam
for getting read access to aComponentStore
.SystemParam
for getting mutable access to aComponentStore
.- Read-only iterator over components matching a given bitset
- Mutable iterator over components matching a given bitset
- Read-only iterator over components matching a given bitset. Returns None for entities matching bitset but not in this ComponentStore.
- Mutable iterator over components matching a given bitset. Returns None for entities matching bitset but not in this ComponentStore.
- A [
HashMap
][hashbrown::HashMap] implementing aHash, a high speed keyed hashing algorithm intended for use in in-memory hashmaps. - A [
HashSet
][hashbrown::HashSet] implementing aHash, a high speed keyed hashing algorithm intended for use in in-memory hashmaps. - An atomic cell containing the
LuaPluginSystemsState
. - Type of session command
- The ID of a system stage.
- An untyped atomic component store.
- A standard
HashMap
usingUstr
as the key type with a customHasher
that just uses the precomputed hash for speed instead of calculating it - A standard
HashSet
usingUstr
as the key type with a customHasher
that just uses the precomputed hash for speed instead of calculating it