[][src]Trait amadeus_core::pool::ThreadPool

pub trait ThreadPool: Clone + Send + Sync + RefUnwindSafe + UnwindSafe + Unpin {
    fn threads(&self) -> usize;
unsafe fn spawn_unchecked<'a, F, Fut, T>(
        &self,
        work: F
    ) -> BoxFuture<'a, Result<T, Box<dyn Error + Send>>>
    where
        F: FnOnce() -> Fut + Send + 'a,
        Fut: Future<Output = T> + 'a,
        T: Send + 'a
; fn spawn<F, Fut, T>(
        &self,
        work: F
    ) -> BoxFuture<'static, Result<T, Box<dyn Error + Send>>>
    where
        F: FnOnce() -> Fut + Send + 'static,
        Fut: Future<Output = T> + 'static,
        T: Send + 'static
, { ... } }

Required methods

fn threads(&self) -> usize

unsafe fn spawn_unchecked<'a, F, Fut, T>(
    &self,
    work: F
) -> BoxFuture<'a, Result<T, Box<dyn Error + Send>>> where
    F: FnOnce() -> Fut + Send + 'a,
    Fut: Future<Output = T> + 'a,
    T: Send + 'a, 

Safety

Must be polled to completion before dropping. Unsound to forget it without having polled to completion.

Loading content...

Provided methods

fn spawn<F, Fut, T>(
    &self,
    work: F
) -> BoxFuture<'static, Result<T, Box<dyn Error + Send>>> where
    F: FnOnce() -> Fut + Send + 'static,
    Fut: Future<Output = T> + 'static,
    T: Send + 'static, 

Loading content...

Implementations on Foreign Types

impl<P: ?Sized, '_> ThreadPool for &'_ P where
    P: ThreadPool
[src]

Loading content...

Implementors

Loading content...