pub struct BlobVec { /* private fields */ }
Expand description

A flat, type-erased data storage type

Used to densely store homogeneous ECS data.

Implementations

Safety
  • index must be in bounds
  • the memory in the BlobVec starting at index index, of a size matching this BlobVec’s item_layout, must have been previously allocated, but not initialized yet
  • the memory at *value must be previously initialized with an item matching this BlobVec’s item_layout
  • the item that was stored in *value is left logically uninitialised/moved out of after calling this function, and as such should not be used or dropped by the caller.
Safety
  • index must be in-bounds
  • the memory in the BlobVec starting at index index, of a size matching this BlobVec’s item_layout, must have been previously initialized with an item matching this BlobVec’s item_layout
  • the memory at *value must also be previously initialized with an item matching this BlobVec’s item_layout
  • the item that was stored in *value is left logically uninitialised/moved out of after calling this function, and as such should not be used or dropped by the caller.

Increases the length by one (and grows the vec if needed) with uninitialized memory and returns the index

Safety

the newly allocated space must be immediately populated with a valid value

Safety

len must be <= capacity. if length is decreased, “out of bounds” items must be dropped. Newly added items must be immediately populated with valid values and length must be increased. For better unwind safety, call BlobVec::set_len after populating a new value.

Performs a “swap remove” at the given index, which removes the item at index and moves the last item in the BlobVec to index (if index is not the last item). It is the caller’s responsibility to drop the returned pointer, if that is desirable.

Safety

It is the caller’s responsibility to ensure that index is < self.len() Callers should only access the returned pointer immediately after calling this function.

Safety

index must be in-bounds

Safety

It is the caller’s responsibility to ensure that index is < self.len()

Gets a pointer to the start of the vec

Safety

must ensure rust mutability rules are not violated

Trait Implementations

Formats the value using the given formatter. Read more

Executes the destructor for this type. 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

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more