Pool

Associated Functions for the Pool type

Built-in associated functions for the Pool<T, N> type.

A sparse collection with stable handles for managing reusable objects.


Handle Management

add

fn add(mut self, element: T) -> Int

Adds an element to the pool and returns a handle (ID) for accessing it.

remove

fn remove(mut self, key: Int)

Removes the element associated with the specified handle.

is_alive

fn is_alive(self, element: Int) -> Bool

Returns true if the handle is still valid (the element hasn’t been removed).


For additional associated functions like len, is_empty, filter, find, etc., see Sequential functions.