Module ds

Source
Expand description

Crate-agnostic general data structures.

This module provides general data structures you can use regardless of ECS. The data structures might not be used directly on client code, but it may be useful for general need. For instance, AnyVec in this module is a vector which is able to contain type-erased values. That is useful when you need to store vectors of various types in a single variable.

Modules§

prelude
Imports things that is likely needed in ECS functinos.

Macros§

tinfo
Creates TypeInfo from the given type and reflects whether the type implements Send, Sync, Default, and Clone to the TypeInfo.

Structs§

ATypeId
A TypeIdExt with a salt type.
AnyVec
A type-erased vector containing values of the same type.
Array
An array type like [T; N], but providing some methods of Vec.
ArrayDeque
An array type like [T; N], but providing some methods of VecDeque.
Borrowed
A type generated by Holder that wraps a value in it shallowly.
ChunkAnyVec
A type-erased vector containing values of the same type.
DebugHelper
A helper type for the FnFmtRaw.
DedupVec
Deduplicated vector.
FlatIter
An iterator that can be created from FlatRawIter with concrete type and lifetime.
FlatIterMut
A mutable iterator that can be created from FlatRawIter with concrete type and lifetime.
FlatRawIter
A type-erased nested iterator.
GenQueue
A queue with generation.
Getter
A getter that can be created from RawGetter with concrete type and lifetime.
GetterMut
A mutable getter that can be created from RawGetter with concrete type and lifetime.
GroupDesc
A descriptor for GroupMap.
GroupMap
A hash map containing Groups and Items.
Holder
A type that holds a value and allows us borrow the value.
IndexedMap
A hash map that you can find a value by an index as well.
IntoIter
An owning iterator over key-value pairs of SetList.
IntoValues
An owning iteartor over values of SetList.
Iter
An iterator that can be created from RawIter with concrete type and lifetime.
IterMut
A mutable iterator that can be created from RawIter with concrete type and lifetime.
ListPos
A position to an item of SetList.
ManagedConstPtr
A wrapper of NonNullExt that can be used to manage a constant pointer.
ManagedMutPtr
A wrapper of NonNullExt that can be used to manage a mutable pointer.
NonNullExt
A pointer that is extended with type id or name.
OptVec
A vector containing optional values.
ParFlatIter
A parallel nested iterator.
ParFlatIterMut
A parallel nested mutable iterator.
ParFlatRawIter
A type-erased parallel nested iterator.
ParIter
An iterator that can be created from ParRawIter with concrete type and lifetime.
ParIterMut
A mutable iterator that can be created from ParRawIter with concrete type and lifetime.
ParRawIter
A type-erased parallel iterator of a slice.
RawGetter
A raw getter for a container of items.
RawIter
A type-erased iterator of a slice.
ReadyFuture
A handle to a ready future data.
SendSyncPtr
A pointer that implements Send and Sync regardless of whether T implements both Send and Sync.
SetList
A list containg unique key-value pairs.
SetValueList
A list containing unique values.
Signal
A data structure that can be used to wake other workers.
SimpleHolder
A Holder that lends its inner value itself by cloning.
SimpleVecPool
Simple vector pool.
TypeHelper
A helper struct used to determine whether a type implements traits like Send, Sync, and Clone by cooperating with helper traits like NotSend , NotSync, and NotClone.
TypeIdExt
Represents an extended TypeId with type name.
TypeInfo
Type information such as TypeId, name, size, and alignment.
TypedAnyVec
A Vec-like type you can get from AnyVec.
UnsafeFuture
A handle to a future data.
Values
An iterator yielding shared references to values of SetList.
ValuesMut
An iterator yielding mutable references to values of SetList.
Xorshift
A random number generator based on 32bits state.

Enums§

BorrowError
An error type associated with borrow.

Traits§

AsDedupVec
A trait for DedupVec.
AsFlatRawIter
A trait to create type-erased flatten iterators from nested types such as Vec<Vec<T>>.
AsRawIter
A trait to create type-erased iterators.
DescribeGroup
A trait for creating GroupDesc.
NotClone
A helper trait for TypeHelper to detect not Clone types.
NotDebug
A helper trait for TypeHelper to detect not Debug types.
NotDefault
A helper trait for TypeHelper to detect not Default types.
NotEqualType
A helper trait for TypeHelper to detect not equal types.
NotSend
A helper trait for TypeHelper to detect not Send types.
NotSync
A helper trait for TypeHelper to detect not Sync types.
NotUnwindSafe
A helper trait for TypeHelper to detect not UnwindSafe types.
WakeSend
A trait to wake a worker and send UnsafeFuture to the worker.

Functions§

block_on
Runs the given future to completion on the current worker.

Type Aliases§

BorrowResult
Result type for Borrowed with BorrowError for error propagation.
FnCloneRaw
Type-erased raw Clone::clone function pointer type.
FnDefaultRaw
Type-erased raw Default::default function pointer type.
FnDropRaw
Type-erased raw Drop::drop function pointer type.
FnFmtRaw
Type-erased raw Debug::fmt function pointer type.