Expand description
The prelude.
Modules§
- bones_
schema - Simple reflection system based on the
#[repr(C)]memory layout.
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. - smallvec
- Creates a
SmallVeccontaining the arguments.
Structs§
- 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. - 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.
- 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>. - Current
System Stage - 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.
- Drain
- An iterator that removes the items from a
SmallVecand yields them by value. - 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. - In
- The system input parameter.
- Into
Iter - An iterator that consumes a
SmallVecand yields its items by value. - Labeled
Id - A
Ulidwith a human-readable ascii prefix. - 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. - 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.- 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
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
Mismatch Error - Error type when attempting to cast between types with mis-matched schemas.
- 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. - Simple
System Stage - A collection of systems that will be run in order.
- Small
Vec - A
Vec-like container that can store a small number of elements inline. - 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. - 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
Resource - An untyped resource that may be inserted into
UntypedResources. - 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. - World
- The
Worldis simply a collection ofResources, andComponentStores.
Enums§
- Collection
Alloc Err - Error type for APIs with fallible heap allocation
- Core
Stage - A
StageLabelfor the 5 core stages. - Enum
TagType - A type for an enum tag for
EnumSchemaInfo. - 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. - Maybe
Owned - This type provides a way to store data to which you either have a reference to or which you do own.
- Maybe
Owned Mut - This type is basically the same as
MaybeOwned, but works with mutable references. - 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
- Turbo
Kind - Enum for determining the kind of PRNG, whether a fast one, or a slow, possibly crypographically secure one.
Constants§
- THREAD_
RNG - A fast, non-cryptographic, thread-local random number generator powered by turborand.
Statics§
- SCHEMA_
REGISTRY - Global
SchemaRegistryused to registerSchemaDatas and produce [Schema]s.
Traits§
- Array
- Types that can be used as the backing store for a
SmallVec. - 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. - Forkable
Core - Trait for enabling creating new
TurboCoreinstances from an original instance. Similar to cloning, except forking modifies the state of the original instance in order to provide a new, random state for the forked instance. This allows for creating many randomised instances from a single seed in a deterministic manner. - 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. - 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. - Query
Item - A type representing a component-joining entity query.
- Secure
Core - A marker trait to be applied to anything that implements
TurboCorein order to indicate that a PRNG source is cryptographically secure, so being a CSPRNG. - Seeded
Core - Trait for implementing Seedable PRNGs, requiring that the PRNG
implements
TurboCoreas a baseline. Seeds must beSizedin order to be used as the internal state of a PRNG. - 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. A stage is a
- ToSmall
Vec - Convenience trait for constructing a
SmallVec - Turbo
Core - Base trait for implementing a PRNG. Only one method must be
implemented:
TurboCore::fill_bytes, which provides the basis for any PRNG, to fill a buffer of bytes with random data. - Turbo
Rand - Extension trait for automatically implementing all
TurboRandmethods, as long as the struct implementsTurboCore&GenCore. All methods are provided as default implementations that build on top ofTurboCoreandGenCore, 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.
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. - 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”. - get_
short_ name - Shortens a type name to remove all module paths.
- likely
- Hints to the compiler that the branch condition is likely to be true. Returns the value passed to it.
- 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.
Type Aliases§
- Atomic
Component Store - An atomic component store.
- Atomic
Untyped Resource - An untyped, atomic resource cell.
- 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
HashMapimplementing aHash, a high speed keyed hashing algorithm intended for use in in-memory hashmaps. - HashSet
- A
HashSetimplementing aHash, a high speed keyed hashing algorithm intended for use in in-memory hashmaps. - 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