[][src]Struct tlid::Pool

pub struct Pool<B: Behavior> { /* fields omitted */ }

generic fast Pool that manages a range of IDs, which can be access via ::next() methods or transfered to a subpool

the range of IDs this pool owns can be fragmented unused IDs will be returned to parent Pool if available (not yet coded)

Methods

impl<B: Behavior> Pool<B>[src]

pub fn new(range: Range<B::Id>) -> Self[src]

pub fn new_full() -> Self where
    B::Id: Bounded
[src]

pub fn next(&mut self) -> B::Return[src]

Return a new ID, according to the Behavior of this Pool main function of this crate for details view the description in the respective Behavior behavior.rs

pub fn subpool(&mut self, size: B::Id) -> Result<Self, AllocError<B::Id>>[src]

takes size IDs from own pool and transfers it to a subpool subpool can be moved to another thread and be safely used there within range creation of subpools takes a few hundred nanos

Trait Implementations

impl<B: Behavior> Debug for Pool<B> where
    B::Id: Display
[src]

impl<B: Behavior> Display for Pool<B> where
    B::Id: Display
[src]

impl<B: Behavior> Drop for Pool<B>[src]

Dropping Pool returns Id's to Parent pool, if it still exists (not yet implemented)

Auto Trait Implementations

impl<B> RefUnwindSafe for Pool<B> where
    B: RefUnwindSafe,
    <B as Behavior>::Id: RefUnwindSafe

impl<B> Send for Pool<B> where
    B: Send,
    <B as Behavior>::Id: Send

impl<B> Sync for Pool<B> where
    B: Sync,
    <B as Behavior>::Id: Sync

impl<B> Unpin for Pool<B> where
    B: Unpin,
    <B as Behavior>::Id: Unpin

impl<B> UnwindSafe for Pool<B> where
    B: UnwindSafe,
    <B as Behavior>::Id: RefUnwindSafe + UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.