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
- github crates-io docs-rs
- bindings
- bones_
schema - Simple reflection system based on the
#[repr(C)]memory layout. - bones_
utils - General utilities for Bones meta-engine crates.
- bool
boolvector mask types.- borrow
- This module contains types that can be used to implement atomic borrowing.
- dashmap
- f32
f32vector, quaternion and matrix types.- f64
f64vector, quaternion and matrix types.- i32
i32vector types.- i64
i64vector types.- piccolo
- swizzles
- Traits adding swizzle methods to all vector types.
- u32
u32vector types.- u64
u64vector types.
Macros§
- bitor
- Shorthand for combining bitsets with bit_or.
- bitset
- Shorthand for setting bits on the bitset container.
- impl_
bitset - Implements the
BitSettrait members for your type throughDerefMut.
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.
- Asset
Extensions - Helper type for storing asset extensions.
- Asset
Info - An identifier for an asset.
- Asset
Load Ctx - Context provided to custom asset loaders in the
AssetLoader::loadmethod. - Asset
Load Progress - The progress that has been made loading the game assets.
- Asset
Loc - Contains that path to an asset, and the pack_dir that it was loaded from.
- Asset
LocRef - A borrowed version of
AssetLoc. - Asset
Pack - An asset pack contains assets that are loaded by the game.
- Asset
Pack Req - A requirement specifier for an asset pack, made up of the asset pack’s
LabeledIdand it’sVersionReq. - Asset
Pack Spec - Specifies an asset pack, and it’s exact version.
- Asset
Server - Struct responsible for loading assets into it’s contained
AssetStore, using anAssetIoimplementation. - Asset
Server Inner - The inner state of the asset server.
- Asset
Store - Stores assets for later retrieval.
- Atomic
Cell - 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. - Atomic
Resource - A handle to a resource from a
Resourcescollection. - BVec2
- A 2-dimensional
boolvector mask. - BVec3
- A 3-dimensional
boolvector mask. - BVec4
- A 4-dimensional
boolvector mask. - BVec3A
- A 3-dimensional SIMD vector mask.
- BVec4A
- A 4-dimensional SIMD vector mask.
- BitFmt
- BitSet formatter.
- BitSet
Vec - The type of bitsets used to track entities in component storages. Mostly used to create caches.
- Cell
Already Present Error - Error thrown when a resource cell cannot be inserted because it already exists.
- Cid
- A unique content ID.
- Command
Queue - A resource containing the
Commandscommand queue. - Commands
- A
SystemParamthat can be used to schedule systems that will be run at the end of the currentSystemStage. - Component
Store - A typed wrapper around
UntypedComponentStore. - Component
Stores - A collection of
ComponentStore<T>. - Core
Packfile Meta - YAML format for the core asset pack’s
pack.yamlfile. - Core
Stage Startup Resource Systems Ran - Resource for tracking whether or not the game has run the startup systems in
CoreStage::StartupResource. - Core
Stage Startup Systems Ran - Resource for tracking whether or not the game has run the startup systems in
CoreStage::Startup. - 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
AssetIoimplementation used for debugging or as a placeholder. - Entities
- Holds a list of alive entities.
- Entities
Iter With - Iterator over entities returned by
Entities::iter_with. - Entity
- An entity index.
- Entity
Iterator - Iterator over entities using the provided bitset.
- Enum
RefAccess - Helper for accessing the inner data of a schema ref at runtime.
- Enum
RefMut Access - Helper for accessing the inner data of a schema ref at runtime.
- Enum
Schema Info - Schema data for an enum.
- Field
Path - 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. - File
Asset Io AssetIoimplementation that loads from the filesystem.- Game
- The
Gameencompasses 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.
- Incompatible
Game Version Error - An error returned when an asset pack does not support the game version.
- Labeled
Id - A
Ulidwith a human-readable ascii prefix. - Loaded
Asset - An asset that has been loaded.
- Loaded
Assets - 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.
- LuaPlugin
Loader Session Plugin - A `SessionPlugin that will run the provided lua plugins
- LuaPlugin
Systems - 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.
- Meta
Asset Load Ctx - Context provided while loading a metadata asset.
- Network
Handle - Asset handle that may be replicated over network and converted back into
HandleorUntypedHandle. - Optional
Query Item - Wrapper for the
CompSystemParamused asQueryItemto iterate over entities optionally retrieving components fromComponentStore. Entities iterated over will not be filtered byOptionalQueryItem. - Optional
Query Item Mut - Wrapper for the
CompMutSystemParamused asQueryItemto iterate over entities optionally and mutably retrieving components fromComponentStore. Entities iterated over will not be filtered byOptionalQueryItemMut. - Packfile
Meta - YAML format for asset packs’
pack.yamlfile. - Quat
- A quaternion representing an orientation.
- Ref
- Wrapper for a borrowed
AtomicCellthat will released lock on drop. - RefMut
- Wrapper for mutably borrowed
AtomicCellthat will released lock on drop. - Res
SystemParamfor getting read access to a resource.- ResInit
SystemParamfor getting read access to a resource and initialzing it if it doesn’t already exist.- ResMut
SystemParamfor getting mutable access to a resource.- ResMut
Init SystemParamfor getting mutable access to a resource and initializing it if it doesn’t already exist.- Reset
World - Convenience type for selecting resources to keep before clearing the
components, entities, and resources on a
World. - Resources
- A collection of resources.
- SBox
- A typed version of
SchemaBox. - SMap
- Typed version of a
SchemaMap. - SVec
- A typed version of a
SchemaVec. - Schema
Asset Handle - Type data for asset handles.
- Schema
Box - A owning, type-erased
Box-like container for types with a [Schema]. - Schema
Data - Schema information describing the memory layout of a type.
- Schema
Deserialize - Derivable schema
type_datafor types that implementDeserialize. - Schema
Deserializer - A struct that implements
DeserializeSeedand can be used to deserialize values matching a given [Schema]. - Schema
Field NotFound Error - Error returned when a field is not found in a schema.
- Schema
Id - A unique identifier for a schema registered in the
SCHEMA_REGISTRY. - Schema
Layout Info - Layout information computed for
SchemaData. - Schema
Map - Untyped schema-aware “HashMap”.
- Schema
MapAccess - Access helper for a
SchemaMap. - Schema
MapMut Access - Mutable
SchemaMapaccess helper. - Schema
Meta Asset Loader - A custom asset loader implementation for a metadata asset.
- Schema
Mismatch Error - Error type when attempting to cast between types with mis-matched schemas.
- Schema
Path - A schema reference, containing the ID of the pack that defined the schema, and the name of the schema in the pack.
- Schema
PtrLoad Ctx - The load context for a
SchemaRefMut. - Schema
Ref - An untyped reference that knows the [
Schema] of the pointee and that can be cast to a matching type. - Schema
RefMut - An untyped mutable reference that knows the [
Schema] of the pointee and that can be cast to a matching type. - Schema
Registry - A schema registry that alloates
SchemaIds forSchemaDatas and returns a registered [&'static Schema][Schema]. - Schema
Serializer - A struct that implements
Serializeand wraps around aSchemaRefto serialize the value using it’s schema. - Schema
Vec - A type-erased
Vec-like collection that for items with the same [Schema]. - Schema
VecAccess - Access helper for a
SchemaVec. - Schema
VecMut Access - Mutable
SchemaVecaccess helper. - Scripting
Game Plugin - Scripting plugin for the bones framework.
- Session
- Contains a bones
Worldfor state,SystemStagesfor behavior, and aSessionRunnerto determine how those are used. - Session
Options - Resource that allows you to configure the current session.
- Sessions
- Container for multiple game sessions.
- Simple
System Stage - A collection of systems that will be run in order.
- Single
Success Systems - Resource tracking which single success systems have completed using a
HashSetof uniqueu64s for the succeeded. - Startup
System Stage SystemStagefor running systems once on startup.- Static
System - Struct containing a static system.
- Struct
Field Info - A field in a
StructSchemaInfo. - Struct
RefAccess - Helper for accessing the inner data of a schema ref at runtime.
- Struct
RefField Iter - Iterator for
StructRefAccess::fields(). - Struct
RefField Iter Field - A field returned by
StructRefFieldIter. - Struct
RefMut Access - Helper for accessing the inner data of a schema ref at runtime.
- Struct
RefMut Field Iter - Iterator for
StructRefAccess::fields(). - Struct
RefMut Field Iter Field - A field returned by
StructRefFieldIter. - Struct
Schema Info - Schema data for a struct.
- System
Stages - An ordered collection of
SystemStages. - 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.
- Untyped
Component Bitset Iterator - 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.
- Untyped
Component Bitset Iterator Mut - 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.
- Untyped
Component Optional Bitset Iterator - 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. - Untyped
Component Optional Bitset Iterator Mut - 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. - Untyped
Component Store - Holds components of a given type indexed by
Entity. - Untyped
Component Store Iter - Mutable iterator over pointers in an untyped component store.
- Untyped
Component Store Iter Mut - Mutable iterator over pointers in an untyped component store.
- Untyped
Handle - An untyped handle to an asset.
- Untyped
Resource - An untyped resource that may be inserted into
UntypedResources. - Untyped
Resource Set - Utility container for storing set of
UntypedResource. Cloning - Untyped
Resources - Storage for un-typed resources.
- Ustr
- A handle representing a string in the global string cache.
- Variant
Info - 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.
- WebAsset
Io - Asset IO implementation that loads assets from a URL.
- World
- The
Worldis simply a collection ofResources, andComponentStores. - World
Ref - A frozen reference to the ECS
World.
Enums§
- Asset
Kind - A type data that indicates how to load a type as an asset.
- Changed
Asset - An ID for an asset that has changed.
- Core
Stage - A
StageLabelfor the 5 core stages. - Enum
TagType - A type for an enum tag for
EnumSchemaInfo. - Euler
Rot - Euler rotation sequences.
- Field
Idx - The index of a field in a struct in a [
Schema]. - Labeled
IdCreate Error - Error creating a
LabeledId. - Labled
IdParse Error - Errors that can happen while parsing a
LabeledId. - LuaPlugin
Systems State - The load state of the [`LuaPluginSystems
- Maybe
- An equivalent to
Option<T>that has a stable memory layout and implementsHasSchema. - Primitive
- A type of primitive.
- Primitive
Ref - Helper for accessing the inner data of a schema ref at runtime.
- Primitive
RefMut - Helper for accessing the inner data of a schema ref at runtime.
- Query
Single Error - 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_bitsetorComponentStore::get_single_mut_with_bitset. - Schema
Kind - A schema describes the data layout of a type, to enable dynamic access to the type’s data through a pointer.
- Schema
RefAccess - Helper for accessing the inner data of a schema ref at runtime.
- Schema
RefMut Access - 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
AssetPackIdof the core pack. - SCHEMA_
REGISTRY - Global
SchemaRegistryused to registerSchemaDatas and produce [Schema]s.
Traits§
- Absolutize
- Let
PathandPathBufhaveabsolutizeandabsolutize_virtuallymethod. - AssetIo
AssetIois a trait that is implemented for backends capable of loading all the games assets and returning the raw bytes stored in asset files.- Asset
Loader - A custom assset loader.
- BitSet
- The BitSet API.
- Component
Iter Bitset - This trait factors out functions for iterating with bitset over component store.
Separated from
impl ComponentStorefor usage in generic trait types that must be able to createComponentBitsetIteratorand related types. - Context
- Provides the
contextmethod forResult. - CtxExt
- Extension trait for the
Contextthat makes it easier to access our lua singletons. - Deserialize
- A data structure that can be deserialized from any data format supported by Serde.
- From
Type - Trait implemented for types that can produce an instance of themselves from a Rust type.
- From
World - Creates an instance of the type this trait is implemented for
using data from the supplied
World. - Game
Plugin - 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]. - Into
System - Converts a function into a
System. - Metatable
Fn - Helper trait to get a singleton fn pointer for the metatable for a type.
- Optional
System Param - Implementing this trait on a
SystemParamwill allow it to be wrapped in anOptionwhen used in a system function. - Query
Item - A type representing a component-joining entity query.
- Serialize
- A data structure that can be serialized into any data format supported by Serde.
- Session
Plugin - Trait for plugins that can be installed into a
Session. - Session
Runner - A session runner is in charge of advancing a
Sessionsimulation. - Stage
Label - Trait for things that may be used to identify a system stage.
- System
- Trait implemented by systems.
- System
Param - Trait used to implement parameters for
Systemfunctions. - System
Stage - Trait for system stages.
- Turbo
Rand - Extension trait for automatically implementing all
TurboRandmethods, 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. - UlidExt
- Extension trait for
Ulid. - Unwrap
Many - Helper trait for unwraping each item in an array.
- Value
Ext - Extension trait on top of
Valueto add helper functions. - Vec2
Swizzles - Vec3
Swizzles - Vec4
Swizzles
Functions§
- Optional
- Helper func to construct a
OptionalQueryItemwrapping aCompSystemParam. Used to iterate over enities optionally retrieving components fromComponentStore. Entities iterated over will not be filtered by thisQueryItem. - Optional
Mut - Helper func to construct a
OptionalQueryItemMutwrapping aCompMutSystemParam. Used to iterate over enities optionally and mutably retrieving components fromComponentStore. Entities iterated over will not be filtered by thisQueryItem. - 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,zandwvalues. - 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,zandwvalues. - single_
success_ system - Wrapper system for single success systems.
- 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§
- Asset
Pack Id - The unique ID for an asset pack.
- Atomic
Component Store - An atomic component store.
- Atomic
Untyped Resource - An untyped, atomic resource cell.
- Boxed
Future - Type alias for
Pin<Box<dyn Future<Output = T> + Send + 'static>>. - Comp
SystemParamfor getting read access to aComponentStore.- CompMut
SystemParamfor getting mutable access to aComponentStore.- Component
Bitset Iterator - Read-only iterator over components matching a given bitset
- Component
Bitset Iterator Mut - Mutable iterator over components matching a given bitset
- Component
Bitset Optional Iterator - Read-only iterator over components matching a given bitset. Returns None for entities matching bitset but not in this ComponentStore.
- Component
Bitset Optional Iterator Mut - 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
- LuaPlugin
Systems Cell - An atomic cell containing the
LuaPluginSystemsState. - Session
Command - Type of session command
- System
Stage Id - The ID of a system stage.
- Untyped
Atomic Component Store - An untyped atomic component store.
- UstrMap
- A standard
HashMapusingUstras the key type with a customHasherthat just uses the precomputed hash for speed instead of calculating it - UstrSet
- A standard
HashSetusingUstras the key type with a customHasherthat just uses the precomputed hash for speed instead of calculating it
Derive Macros§
- Deref
- Derive macro for deriving
Derefon structs with one field. - Deref
Mut - Derive macro for deriving
DerefMuton structs with one field. - Deserialize
- HasSchema
- Derive macro for the HasSchema trait.
- Serialize
- System
Param