Struct crayon::utils::handle_pool::HandlePool
[−]
[src]
pub struct HandlePool { /* fields omitted */ }
HandlePool
manages the manipulations of a Handle
collection, which are
created with a continuous index
field. It also have the ability to find
out the current status of a specified Handle
.
Methods
impl HandlePool
[src]
fn new() -> HandlePool
[src]
Constructs a new, empty HandlePool
.
fn with_capacity(capacity: usize) -> HandlePool
[src]
Constructs a new HandlePool
with the specified capacity.
fn create(&mut self) -> Handle
[src]
Creates a unused Handle
.
fn is_alive<T>(&self, handle: T) -> bool where
T: Borrow<Handle>,
[src]
T: Borrow<Handle>,
Returns true if this Handle
was created by HandlePool
, and has not been
freed yet.
fn free<T>(&mut self, handle: T) -> bool where
T: Borrow<Handle>,
[src]
T: Borrow<Handle>,
Recycles the Handle
index, and mark its version as dead.
fn free_at(&mut self, index: usize) -> Option<Handle>
[src]
Recycles the Handle
index, and mark its version as dead.
fn len(&self) -> usize
[src]
Returns the total number of alive handle in this HandlePool
.
fn iter(&self) -> HandleIter
[src]
Returns an iterator over the HandlePool
.