[−][src]Struct tlid::Pool
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]
B::Id: Bounded,
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]
B::Id: Display,
impl<B: Behavior> Display for Pool<B> where
B::Id: Display,
[src]
B::Id: Display,
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,
B: RefUnwindSafe,
<B as Behavior>::Id: RefUnwindSafe,
impl<B> Send for Pool<B> where
B: Send,
<B as Behavior>::Id: Send,
B: Send,
<B as Behavior>::Id: Send,
impl<B> Sync for Pool<B> where
B: Sync,
<B as Behavior>::Id: Sync,
B: Sync,
<B as Behavior>::Id: Sync,
impl<B> Unpin for Pool<B> where
B: Unpin,
<B as Behavior>::Id: Unpin,
B: Unpin,
<B as Behavior>::Id: Unpin,
impl<B> UnwindSafe for Pool<B> where
B: UnwindSafe,
<B as Behavior>::Id: RefUnwindSafe + UnwindSafe,
B: UnwindSafe,
<B as Behavior>::Id: RefUnwindSafe + UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,