Trait amadeus_core::pool::ThreadPool [−][src]
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
[src]
fn threads(&self) -> usize
[src]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,
[src]
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,
[src]Safety
Must be polled to completion before dropping. Unsound to forget it without having polled to completion.
Provided methods
Implementations on Foreign Types
impl<P: ?Sized> ThreadPool for &P where
P: ThreadPool,
[src]
impl<P: ?Sized> ThreadPool for &P where
P: ThreadPool,
[src]fn threads(&self) -> usize
[src]
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,
[src]
&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,
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,
[src]
&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,