pub struct ListPool<T: EntityRef + ReservedValue> { /* private fields */ }
Expand description

A memory pool for storing lists of T.

Implementations§

Create a new list pool.

Examples found in repository?
src/list.rs (line 109)
108
109
110
    fn default() -> Self {
        Self::new()
    }

Create a new list pool with the given capacity for data pre-allocated.

Get the capacity of this pool. This will be somewhat higher than the total length of lists that can be stored without reallocating, because of internal metadata overheads. It is mostly useful to allow another pool to be allocated that is likely to hold data transferred from this one without the need to grow.

Clear the pool, forgetting about all lists that use it.

This invalidates any existing entity lists that used this pool to allocate memory.

The pool’s memory is not released to the operating system, but kept around for faster allocation in the future.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

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

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
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.