Trait oxygengine_core::ecs::hibitset::BitSetLike [−]
pub trait BitSetLike {
fn layer3(&self) -> usize;
fn layer2(&self, i: usize) -> usize;
fn layer1(&self, i: usize) -> usize;
fn layer0(&self, i: usize) -> usize;
fn contains(&self, i: u32) -> bool;
fn get_from_layer(&self, layer: usize, idx: usize) -> usize { ... }
fn is_empty(&self) -> bool { ... }
fn iter(self) -> BitIter<Self>ⓘ { ... }
}Expand description
A generic interface for BitSetLike-like types.
Every BitSetLike is hierarchical, meaning that there
are multiple levels that branch out in a tree like structure.
Layer0 each bit represents one Index of the set
Layer1 each bit represents one usize of Layer0, and will be
set only if the word below it is not zero.
Layer2 has the same arrangement but with Layer1, and Layer3 with Layer2.
This arrangement allows for rapid jumps across the key-space.
Required methods
Return a usize where each bit represents if any word in layer2
has been set.
Return the usize from the array of usizes that indicates if any
bit has been set in layer1
Return the usize from the array of usizes that indicates if any
bit has been set in layer0
Return a usize that maps to the direct 1:1 association with
each index of the set
Provided methods
fn get_from_layer(&self, layer: usize, idx: usize) -> usize
fn get_from_layer(&self, layer: usize, idx: usize) -> usizeGets the usize corresponding to layer and index.
The layer should be in the range [0, 3]
Trait Implementations
type Mask = &'a (dyn BitSetLike + 'a)
type Mask = &'a (dyn BitSetLike + 'a)Type of joined bit mask.
pub unsafe fn open(
self
) -> (<&'a (dyn BitSetLike + 'a) as Join>::Mask, <&'a (dyn BitSetLike + 'a) as Join>::Value)[src]
pub unsafe fn open(
self
) -> (<&'a (dyn BitSetLike + 'a) as Join>::Mask, <&'a (dyn BitSetLike + 'a) as Join>::Value)[src]Open this join by returning the mask and the storages. Read more
pub unsafe fn get(
&mut <&'a (dyn BitSetLike + 'a) as Join>::Value,
id: u32
) -> <&'a (dyn BitSetLike + 'a) as Join>::Type[src]
pub unsafe fn get(
&mut <&'a (dyn BitSetLike + 'a) as Join>::Value,
id: u32
) -> <&'a (dyn BitSetLike + 'a) as Join>::Type[src]Get a joined component value by a given index. Read more
Create a joined iterator over the contents.
Returns a Join-able structure that yields all indices, returning
None for all missing elements and Some(T) for found elements. Read more
If this Join typically returns all indices in the mask, then iterating
over only it or combined with other joins that are also dangerous
will cause the JoinIter/ParJoin to go through all indices which
is usually not what is wanted and will kill performance. Read more
Implementations on Foreign Types
impl<'a, T> BitSetLike for &'a T where
T: BitSetLike + ?Sized,
impl<'a, T> BitSetLike for &'a T where
T: BitSetLike + ?Sized, impl<'a, T> BitSetLike for &'a mut T where
T: BitSetLike + ?Sized,
impl<'a, T> BitSetLike for &'a mut T where
T: BitSetLike + ?Sized, Implementors
impl BitSetLike for BitSet
impl BitSetLike for BitSetimpl BitSetLike for AtomicBitSet
impl BitSetLike for AtomicBitSetimpl BitSetLike for BitSetAll
impl BitSetLike for BitSetAllimpl<A> BitSetLike for BitSetNot<A> where
A: BitSetLike,
impl<A> BitSetLike for BitSetNot<A> where
A: BitSetLike, impl<A, B> BitSetLike for BitSetAnd<A, B> where
A: BitSetLike,
B: BitSetLike,
impl<A, B> BitSetLike for BitSetAnd<A, B> where
A: BitSetLike,
B: BitSetLike, impl<A, B> BitSetLike for BitSetOr<A, B> where
A: BitSetLike,
B: BitSetLike,
impl<A, B> BitSetLike for BitSetOr<A, B> where
A: BitSetLike,
B: BitSetLike,