Module prelude

Module 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§

anyhow
githubcrates-iodocs-rs
bindings
bones_schema
Simple reflection system based on the #[repr(C)] memory layout.
bones_utils
General utilities for Bones meta-engine crates.
bool
bool vector mask types.
borrow
This module contains types that can be used to implement atomic borrowing.
dashmap
f32
f32 vector, quaternion and matrix types.
f64
f64 vector, quaternion and matrix types.
i32
i32 vector types.
i64
i64 vector types.
piccolo
swizzles
Traits adding swizzle methods to all vector types.
u32
u32 vector types.
u64
u64 vector types.

Macros§

bitor
Shorthand for combining bitsets with bit_or.
bitset
Shorthand for setting bits on the bitset container.
impl_bitset
Implements the BitSet trait members for your type through DerefMut.

Structs§

Affine2
A 2D affine transform, which can represent translation, rotation, scaling and shear.
Affine3A
A 3D affine transform, which can represent translation, rotation, scaling and shear.
AssetExtensions
Helper type for storing asset extensions.
AssetInfo
An identifier for an asset.
AssetLoadCtx
Context provided to custom asset loaders in the AssetLoader::load method.
AssetLoadProgress
The progress that has been made loading the game assets.
AssetLoc
Contains that path to an asset, and the pack_dir that it was loaded from.
AssetLocRef
A borrowed version of AssetLoc.
AssetPack
An asset pack contains assets that are loaded by the game.
AssetPackReq
A requirement specifier for an asset pack, made up of the asset pack’s LabeledId and it’s VersionReq.
AssetPackSpec
Specifies an asset pack, and it’s exact version.
AssetServer
Struct responsible for loading assets into it’s contained AssetStore, using an AssetIo implementation.
AssetServerInner
The inner state of the asset server.
AssetStore
Stores assets for later retrieval.
AtomicCell
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.
AtomicResource
A handle to a resource from a Resources collection.
BVec2
A 2-dimensional bool vector mask.
BVec3
A 3-dimensional bool vector mask.
BVec4
A 4-dimensional bool vector mask.
BVec3A
A 3-dimensional SIMD vector mask.
BVec4A
A 4-dimensional SIMD vector mask.
BitFmt
BitSet formatter.
BitSetVec
The type of bitsets used to track entities in component storages. Mostly used to create caches.
CellAlreadyPresentError
Error thrown when a resource cell cannot be inserted because it already exists.
Cid
A unique content ID.
CommandQueue
A resource containing the Commands command queue.
Commands
A SystemParam that can be used to schedule systems that will be run at the end of the current SystemStage.
ComponentStore
A typed wrapper around UntypedComponentStore.
ComponentStores
A collection of ComponentStore<T>.
CorePackfileMeta
YAML format for the core asset pack’s pack.yaml file.
CurrentSystemStage
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.
DAffine2
A 2D affine transform, which can represent translation, rotation, scaling and shear.
DAffine3
A 3D affine transform, which can represent translation, rotation, scaling and shear.
DMat2
A 2x2 column major matrix.
DMat3
A 3x3 column major matrix.
DMat4
A 4x4 column major matrix.
DQuat
A quaternion representing an orientation.
DVec2
A 2-dimensional vector.
DVec3
A 3-dimensional vector.
DVec4
A 4-dimensional vector.
DummyIo
Dummy AssetIo implementation used for debugging or as a placeholder.
Entities
Holds a list of alive entities.
EntitiesIterWith
Iterator over entities returned by Entities::iter_with.
Entity
An entity index.
EntityIterator
Iterator over entities using the provided bitset.
EnumRefAccess
Helper for accessing the inner data of a schema ref at runtime.
EnumRefMutAccess
Helper for accessing the inner data of a schema ref at runtime.
EnumSchemaInfo
Schema data for an enum.
FieldPath
A wrapper type that implements IntoIterator<Item = FieldIdx> for an inner string to make it easier to use with SchemaRefAccess::field_path() and other field path methods.
FileAssetIo
AssetIo implementation that loads from the filesystem.
Game
The Game encompasses a complete bones game’s logic, independent of the renderer and IO implementations.
Handle
A typed handle to an asset.
I64Vec2
A 2-dimensional vector.
I64Vec3
A 3-dimensional vector.
I64Vec4
A 4-dimensional vector.
IVec2
A 2-dimensional vector.
IVec3
A 3-dimensional vector.
IVec4
A 4-dimensional vector.
In
The system input parameter.
IncompatibleGameVersionError
An error returned when an asset pack does not support the game version.
LabeledId
A Ulid with a human-readable ascii prefix.
LoadedAsset
An asset that has been loaded.
LoadedAssets
Struct containing all the game’s loaded assets, including the default assets and asset-packs/mods.
LuaEngine
Resource used to access the lua scripting engine.
LuaPlugin
A lua plugin asset.
LuaPluginLoaderSessionPlugin
A `SessionPlugin that will run the provided lua plugins
LuaPluginSystems
The systems that have been registered by a lua plugin.
LuaPlugins
Resource containing the lua plugins that have been installed in this session.
LuaScript
A Lua script asset.
LuaSingletons
Struct for accessing and initializing lua singletons.
Mat2
A 2x2 column major matrix.
Mat3
A 3x3 column major matrix.
Mat4
A 4x4 column major matrix.
Mat3A
A 3x3 column major matrix.
MetaAssetLoadCtx
Context provided while loading a metadata asset.
NetworkHandle
Asset handle that may be replicated over network and converted back into Handle or UntypedHandle.
OptionalQueryItem
Wrapper for the Comp SystemParam used as QueryItem to iterate over entities optionally retrieving components from ComponentStore. Entities iterated over will not be filtered by OptionalQueryItem.
OptionalQueryItemMut
Wrapper for the CompMut SystemParam used as QueryItem to iterate over entities optionally and mutably retrieving components from ComponentStore. Entities iterated over will not be filtered by OptionalQueryItemMut.
PackfileMeta
YAML format for asset packs’ pack.yaml file.
Quat
A quaternion representing an orientation.
Ref
Wrapper for a borrowed AtomicCell that will released lock on drop.
RefMut
Wrapper for mutably borrowed AtomicCell that will released lock on drop.
Res
SystemParam for getting read access to a resource.
ResInit
SystemParam for getting read access to a resource and initialzing it if it doesn’t already exist.
ResMut
SystemParam for getting mutable access to a resource.
ResMutInit
SystemParam for getting mutable access to a resource and initializing it if it doesn’t already exist.
ResetWorld
Resource that allows user to trigger a reset of world, clearing entities, components, and resources. This is supported in bone’s default session runners - but if implementing custom runner, must call world.handle_world_reset inside step.
Resources
A collection of resources.
SBox
A typed version of SchemaBox.
SMap
Typed version of a SchemaMap.
SVec
A typed version of a SchemaVec.
SchemaAssetHandle
Type data for asset handles.
SchemaBox
A owning, type-erased Box-like container for types with a [Schema].
SchemaData
Schema information describing the memory layout of a type.
SchemaDeserialize
Derivable schema type_data for types that implement Deserialize.
SchemaDeserializer
A struct that implements DeserializeSeed and can be used to deserialize values matching a given [Schema].
SchemaFieldNotFoundError
Error returned when a field is not found in a schema.
SchemaId
A unique identifier for a schema registered in the SCHEMA_REGISTRY.
SchemaLayoutInfo
Layout information computed for SchemaData.
SchemaMap
Untyped schema-aware “HashMap”.
SchemaMapAccess
Access helper for a SchemaMap.
SchemaMapMutAccess
Mutable SchemaMap access helper.
SchemaMetaAssetLoader
A custom asset loader implementation for a metadata asset.
SchemaMismatchError
Error type when attempting to cast between types with mis-matched schemas.
SchemaPath
A schema reference, containing the ID of the pack that defined the schema, and the name of the schema in the pack.
SchemaPtrLoadCtx
The load context for a SchemaRefMut.
SchemaRef
An untyped reference that knows the [Schema] of the pointee and that can be cast to a matching type.
SchemaRefMut
An untyped mutable reference that knows the [Schema] of the pointee and that can be cast to a matching type.
SchemaRegistry
A schema registry that alloates SchemaIds for SchemaDatas and returns a registered [&'static Schema][Schema].
SchemaSerializer
A struct that implements Serialize and wraps around a SchemaRef to serialize the value using it’s schema.
SchemaVec
A type-erased Vec-like collection that for items with the same [Schema].
SchemaVecAccess
Access helper for a SchemaVec.
SchemaVecMutAccess
Mutable SchemaVec access helper.
ScriptingGamePlugin
Scripting plugin for the bones framework.
Session
A bones game. This includes all of the game worlds, and systems.
SessionBuilder
Builder type used to create Session. If using this directly (as opposed to Sessions::create_with), it is important to rember to finish session and add to Sessions with SessionBuilder::finish_and_add.
SessionOptions
Resource that allows you to configure the current session.
SessionStarted
Resource tracking if Session has started (startup systems executed and resources inserted). If field is set to false, that operation needs to be handled on next stage run. If resource is not present, assumed to have not started (and will be initialized upon next stage execution).
Sessions
Container for multiple game sessions.
SimpleSystemStage
A collection of systems that will be run in order.
SingleSuccessSystems
Resource tracking which of single success systems in Session’s SystemStages have completed. Success is tracked to
StaticSystem
Struct containing a static system.
StructFieldInfo
A field in a StructSchemaInfo.
StructRefAccess
Helper for accessing the inner data of a schema ref at runtime.
StructRefFieldIter
Iterator for StructRefAccess::fields().
StructRefFieldIterField
A field returned by StructRefFieldIter.
StructRefMutAccess
Helper for accessing the inner data of a schema ref at runtime.
StructRefMutFieldIter
Iterator for StructRefAccess::fields().
StructRefMutFieldIterField
A field returned by StructRefFieldIter.
StructSchemaInfo
Schema data for a struct.
SystemStages
An ordered collection of SystemStages.
SystemStagesBuilder
Builder for SystemStages. It is immutable once created,
Time
A clock that tracks how much it has advanced (and how much real time has elapsed) since its previous update and since its creation.
U64Vec2
A 2-dimensional vector.
U64Vec3
A 3-dimensional vector.
U64Vec4
A 4-dimensional vector.
UVec2
A 2-dimensional vector.
UVec3
A 3-dimensional vector.
UVec4
A 4-dimensional vector.
Ulid
A Ulid is a unique 128-bit lexicographically sortable identifier
Unsafe
A wrapper struct that marks it unsafe to both create and access the inner value.
UntypedComponentBitsetIterator
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.
UntypedComponentBitsetIteratorMut
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.
UntypedComponentOptionalBitsetIterator
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.
UntypedComponentOptionalBitsetIteratorMut
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.
UntypedComponentStore
Holds components of a given type indexed by Entity.
UntypedComponentStoreIter
Mutable iterator over pointers in an untyped component store.
UntypedComponentStoreIterMut
Mutable iterator over pointers in an untyped component store.
UntypedHandle
An untyped handle to an asset.
UntypedResource
An untyped resource that may be inserted into UntypedResources.
UntypedResourceSet
Utility container for storing set of UntypedResource. Cloning
UntypedResources
Storage for un-typed resources.
Ustr
A handle representing a string in the global string cache.
VariantInfo
Information about an enum variant for EnumSchemaInfo.
Vec2
A 2-dimensional vector.
Vec3
A 3-dimensional vector.
Vec4
A 4-dimensional vector.
Vec3A
A 3-dimensional vector.
Version
SemVer version as defined by https://semver.org.
WebAssetIo
Asset IO implementation that loads assets from a URL.
World
The World is simply a collection of Resources, and ComponentStores.
WorldRef
A frozen reference to the ECS World.

Enums§

AssetKind
A type data that indicates how to load a type as an asset.
ChangedAsset
An ID for an asset that has changed.
CoreStage
A StageLabel for the 5 core stages.
EnumTagType
A type for an enum tag for EnumSchemaInfo.
EulerRot
Euler rotation sequences.
FieldIdx
The index of a field in a struct in a [Schema].
LabeledIdCreateError
Error creating a LabeledId.
LabledIdParseError
Errors that can happen while parsing a LabeledId.
LuaPluginSystemsState
The load state of the [`LuaPluginSystems
Maybe
An equivalent to Option<T> that has a stable memory layout and implements HasSchema.
Primitive
A type of primitive.
PrimitiveRef
Helper for accessing the inner data of a schema ref at runtime.
PrimitiveRefMut
Helper for accessing the inner data of a schema ref at runtime.
QuerySingleError
An error that may occur when querying for a single entity. For example, via Entities::get_single_with, or more directly with ComponentStore::get_single_with_bitset or ComponentStore::get_single_mut_with_bitset.
SchemaKind
A schema describes the data layout of a type, to enable dynamic access to the type’s data through a pointer.
SchemaRefAccess
Helper for accessing the inner data of a schema ref at runtime.
SchemaRefMutAccess
Access a schema

Constants§

BITSET_EXP
THREAD_RNG
A fast, non-cryptographic, thread-local random number generator powered by turborand.

Statics§

CORE_PACK_ID
The AssetPackId of the core pack.
SCHEMA_REGISTRY
Global SchemaRegistry used to register SchemaDatas and produce [Schema]s.

Traits§

Absolutize
Let Path and PathBuf have absolutize and absolutize_virtually method.
AssetIo
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.
AssetLoader
A custom assset loader.
BitSet
The BitSet API.
ComponentIterBitset
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 create ComponentBitsetIterator and related types.
Context
Provides the context method for Result.
CtxExt
Extension trait for the Context that makes it easier to access our lua singletons.
Deserialize
A data structure that can be deserialized from any data format supported by Serde.
FromType
Trait implemented for types that can produce an instance of themselves from a Rust type.
FromWorld
Creates an instance of the type this trait is implemented for using data from the supplied World.
GamePlugin
Trait for plugins that can be installed into a Game.
GenCore
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.
HasSchema
Trait implemented for types that have a [Schema].
IntoSystem
Converts a function into a System.
MetatableFn
Helper trait to get a singleton fn pointer for the metatable for a type.
QueryItem
A type representing a component-joining entity query.
Serialize
A data structure that can be serialized into any data format supported by Serde.
SessionPlugin
Trait for plugins that can be installed into a Session.
SessionRunner
A session runner is in charge of advancing a Session simulation.
StageLabel
Trait for things that may be used to identify a system stage.
System
Trait implemented by systems.
SystemParam
Trait used to implement parameters for System functions.
SystemStage
Trait for system stages. A stage is a
TurboRand
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] and GenCore, and thus are not recommended to be overridden, lest you potentially change the expected outcome of the methods.
UlidExt
Extension trait for Ulid.
UnwrapMany
Helper trait for unwraping each item in an array.
ValueExt
Extension trait on top of Value to add helper functions.
Vec2Swizzles
Vec3Swizzles
Vec4Swizzles
WorldExt
Extension of World

Functions§

Optional
Helper func to construct a OptionalQueryItem wrapping a Comp SystemParam. Used to iterate over enities optionally retrieving components from ComponentStore. Entities iterated over will not be filtered by this QueryItem.
OptionalMut
Helper func to construct a OptionalQueryItemMut wrapping a CompMut SystemParam. Used to iterate over enities optionally and mutably retrieving components from ComponentStore. Entities iterated over will not be filtered by this QueryItem.
asset_loader
Helper function to return type data for a custom asset loader.
create_bitset
Creates a bitset big enough to contain the index of each entity. Mostly used to create caches.
default
An ergonomic abbreviation for Default::default() to make initializing structs easier. This is especially helpful when combined with “struct update syntax”.
dmat2
Creates a 2x2 matrix from two column vectors.
dmat3
Creates a 3x3 matrix from three column vectors.
dmat4
Creates a 4x4 matrix from four column vectors.
dquat
Creates a quaternion from x, y, z and w values.
dvec2
Creates a 2-dimensional vector.
dvec3
Creates a 3-dimensional vector.
dvec4
Creates a 4-dimensional vector.
get_short_name
Shortens a type name to remove all module paths.
i64vec2
Creates a 2-dimensional vector.
i64vec3
Creates a 3-dimensional vector.
i64vec4
Creates a 4-dimensional vector.
ivec2
Creates a 2-dimensional vector.
ivec3
Creates a 3-dimensional vector.
ivec4
Creates a 4-dimensional vector.
likely
Hints to the compiler that the branch condition is likely to be true. Returns the value passed to it.
lua_game_plugin
Install the lua scripting plugin.
mat2
Creates a 2x2 matrix from two column vectors.
mat3
Creates a 3x3 matrix from three column vectors.
mat4
Creates a 4x4 matrix from four column vectors.
mat3a
Creates a 3x3 matrix from three column vectors.
metadata_asset
Helper function to return type data for a metadata asset.
quat
Creates a quaternion from x, y, z and w values.
u64vec2
Creates a 2-dimensional vector.
u64vec3
Creates a 3-dimensional vector.
u64vec4
Creates a 4-dimensional vector.
unlikely
Hints to the compiler that the branch condition is unlikely to be true. Returns the value passed to it.
ustr
Create a new Ustr from the given &str.
uvec2
Creates a 2-dimensional vector.
uvec3
Creates a 3-dimensional vector.
uvec4
Creates a 4-dimensional vector.
vec2
Creates a 2-dimensional vector.
vec3
Creates a 3-dimensional vector.
vec4
Creates a 4-dimensional vector.
vec3a
Creates a 3-dimensional vector.

Type Aliases§

AssetPackId
The unique ID for an asset pack.
AtomicComponentStore
An atomic component store.
AtomicUntypedResource
An untyped, atomic resource cell.
BoxedFuture
Type alias for Pin<Box<dyn Future<Output = T> + Send + 'static>>.
Comp
SystemParam for getting read access to a ComponentStore.
CompMut
SystemParam for getting mutable access to a ComponentStore.
ComponentBitsetIterator
Read-only iterator over components matching a given bitset
ComponentBitsetIteratorMut
Mutable iterator over components matching a given bitset
ComponentBitsetOptionalIterator
Read-only iterator over components matching a given bitset. Returns None for entities matching bitset but not in this ComponentStore.
ComponentBitsetOptionalIteratorMut
Mutable iterator over components matching a given bitset. Returns None for entities matching bitset but not in this ComponentStore.
HashMap
A [HashMap][hashbrown::HashMap] implementing aHash, a high speed keyed hashing algorithm intended for use in in-memory hashmaps.
HashSet
A [HashSet][hashbrown::HashSet] implementing aHash, a high speed keyed hashing algorithm intended for use in in-memory hashmaps.
Instant
LuaPluginSystemsCell
An atomic cell containing the LuaPluginSystemsState.
SessionCommand
Type of session command
SystemStageId
The ID of a system stage.
UntypedAtomicComponentStore
An untyped atomic component store.
UstrMap
A standard HashMap using Ustr as the key type with a custom Hasher that just uses the precomputed hash for speed instead of calculating it
UstrSet
A standard HashSet using Ustr as the key type with a custom Hasher that just uses the precomputed hash for speed instead of calculating it

Derive Macros§

Deref
Derive macro for deriving Deref on structs with one field.
DerefMut
Derive macro for deriving DerefMut on structs with one field.
Deserialize
HasSchema
Derive macro for the HasSchema trait.
Serialize
SystemParam