Trait drone_core::thr::ThrToken [−][src]
pub unsafe trait ThrToken where
Self: Sized + Clone + Copy,
Self: Send + Sync + 'static,
Self: Token, { type Thread: Thread; const THR_IDX: u16; fn to_thr(self) -> &'static Self::Thread { ... } fn add_fib<F>(self, fib: F)
where
F: RootFiber + Send, { ... } fn add_fib_factory<C, F>(self, factory: C)
where
C: FnOnce() -> F + Send + 'static,
F: RootFiber, { ... } fn is_empty(self) -> bool { ... } }
Token for a thread in a thread pool.
Safety
- At most one trait implementation per thread must exist.
ThrToken::THR_IDXmust be less than [ThrToken::Thread::COUNT].
Associated Types
Loading content...Associated Constants
Loading content...Provided methods
fn to_thr(self) -> &'static Self::Thread[src]
Returns a reference to the thread object.
fn add_fib<F>(self, fib: F) where
F: RootFiber + Send, [src]
F: RootFiber + Send,
Adds the fiber fib to the fiber chain.
fn add_fib_factory<C, F>(self, factory: C) where
C: FnOnce() -> F + Send + 'static,
F: RootFiber, [src]
C: FnOnce() -> F + Send + 'static,
F: RootFiber,
Adds the fiber returned by factory to the fiber chain.
This method is useful for non-Send fibers.
fn is_empty(self) -> bool[src]
Returns true if the fiber chain is empty.