Struct genesis::VecStorage[][src]

pub struct VecStorage<T> { /* fields omitted */ }
Expand description

A storage type that stores components in a contiguous Vec.

Implementations

Create a new VecStorage with the specified initial capacity.

Get a reference to the component associated with the given entity in self, if any.

Get a mutable reference to the component associated with the given entity in self, if any.

Set the component for the given entity. Returns Err(NoSuchEntity) if the given entity doesn’t exist. Otherwise, returns Ok(data), where data is previous data evicted by this operation (if any).

Remove the component for the given entity. Returns the previous data associated with the given entity in self. Does not check if the entity exists; only use this if you know it exists, e.g. through invariants in your code or because you retrieved this in a loop iterating over all alive entities.

Remove the component for the given entity. Returns the previous data associated with the given entity in self.

Remove the data stored in self for all entities.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.