Struct froggy::Storage
[−]
[src]
pub struct Storage<T> { /* fields omitted */ }
Component storage type. Manages the components and allows for efficient processing.
Methods
impl<T> Storage<T>
[src]
fn new() -> Storage<T>
Create a new empty storage.
fn with_capacity(capacity: usize) -> Storage<T>
Create a new empty storage with specified capacity.
fn sync_pending(&mut self)
Synchronize for all the pending updates.
fn iter(&self) -> ReadIter<T>
Iterate all components in this storage.
fn iter_alive(&self) -> ReadIter<T>
Iterate all components that are still referenced by something.
fn iter_mut(&mut self) -> WriteIter<T>
Iterate all components in this storage, mutably.
fn iter_alive_mut(&mut self) -> WriteIter<T>
Iterate all components that are still referenced by something, mutably.
fn pin(&self, item: &ReadItem<T>) -> Pointer<T>
Pin an iterated item with a newly created Pointer
.
fn cursor(&mut self) -> Cursor<T>
Produce a streaming mutable iterator.
fn cursor_alive(&mut self) -> Cursor<T>
Produce a streaming iterator that skips over lost elements.
fn create(&mut self, value: T) -> Pointer<T>
Add a new component to the storage, returning the Pointer
to it.
Trait Implementations
impl<'a, T> Index<&'a Pointer<T>> for Storage<T>
[src]
type Output = T
The returned type after indexing
fn index(&self, pointer: &'a Pointer<T>) -> &T
The method for the indexing (container[index]
) operation
impl<'a, T> IndexMut<&'a Pointer<T>> for Storage<T>
[src]
fn index_mut(&mut self, pointer: &'a Pointer<T>) -> &mut T
The method for the mutable indexing (container[index]
) operation
impl<T> FromIterator<T> for Storage<T>
[src]
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator<Item = T>,
I: IntoIterator<Item = T>,
Creates a value from an iterator. Read more
impl<'a, T> IntoIterator for &'a Storage<T>
[src]
type Item = ReadItem<'a, T>
The type of the elements being iterated over.
type IntoIter = ReadIter<'a, T>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
Creates an iterator from a value. Read more