Trait amadeus_core::pool::ProcessPool [−][src]
pub trait ProcessPool: Clone + Send + Sync + RefUnwindSafe + UnwindSafe + Unpin { type ThreadPool: ThreadPool + 'static; fn processes(&self) -> usize; unsafe fn spawn_unchecked<'a, F, Fut, T>(
&self,
work: F
) -> BoxFuture<'a, Result<T, Box<dyn Error + Send>>>
where
F: FnOnce(&Self::ThreadPool) -> Fut + ProcessSend + 'a,
Fut: Future<Output = T> + 'a,
T: ProcessSend + 'a; fn spawn<F, Fut, T>(
&self,
work: F
) -> BoxFuture<'static, Result<T, Box<dyn Error + Send>>>
where
F: FnOnce(&Self::ThreadPool) -> Fut + ProcessSend + 'static,
Fut: Future<Output = T> + 'static,
T: ProcessSend + 'static, { ... } }
Associated Types
type ThreadPool: ThreadPool + 'static
[src]
type ThreadPool: ThreadPool + 'static
[src]Required methods
fn processes(&self) -> usize
[src]
fn processes(&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(&Self::ThreadPool) -> Fut + ProcessSend + 'a,
Fut: Future<Output = T> + 'a,
T: ProcessSend + 'a,
[src]
unsafe fn spawn_unchecked<'a, F, Fut, T>(
&self,
work: F
) -> BoxFuture<'a, Result<T, Box<dyn Error + Send>>> where
F: FnOnce(&Self::ThreadPool) -> Fut + ProcessSend + 'a,
Fut: Future<Output = T> + 'a,
T: ProcessSend + 'a,
[src]Safety
Must be polled to completion before dropping. Unsound to forget it without having polled to completion.
Provided methods
fn spawn<F, Fut, T>(
&self,
work: F
) -> BoxFuture<'static, Result<T, Box<dyn Error + Send>>> where
F: FnOnce(&Self::ThreadPool) -> Fut + ProcessSend + 'static,
Fut: Future<Output = T> + 'static,
T: ProcessSend + 'static,
[src]
fn spawn<F, Fut, T>(
&self,
work: F
) -> BoxFuture<'static, Result<T, Box<dyn Error + Send>>> where
F: FnOnce(&Self::ThreadPool) -> Fut + ProcessSend + 'static,
Fut: Future<Output = T> + 'static,
T: ProcessSend + 'static,
[src]Implementations on Foreign Types
impl<P: ?Sized> ProcessPool for &P where
P: ProcessPool,
[src]
impl<P: ?Sized> ProcessPool for &P where
P: ProcessPool,
[src]type ThreadPool = P::ThreadPool
fn processes(&self) -> usize
[src]
fn spawn<F, Fut, T>(
&self,
work: F
) -> BoxFuture<'static, Result<T, Box<dyn Error + Send>>> where
F: FnOnce(&Self::ThreadPool) -> Fut + ProcessSend + 'static,
Fut: Future<Output = T> + 'static,
T: ProcessSend + 'static,
[src]
&self,
work: F
) -> BoxFuture<'static, Result<T, Box<dyn Error + Send>>> where
F: FnOnce(&Self::ThreadPool) -> Fut + ProcessSend + 'static,
Fut: Future<Output = T> + 'static,
T: ProcessSend + 'static,
unsafe fn spawn_unchecked<'a, F, Fut, T>(
&self,
work: F
) -> BoxFuture<'a, Result<T, Box<dyn Error + Send>>> where
F: FnOnce(&Self::ThreadPool) -> Fut + ProcessSend + 'a,
Fut: Future<Output = T> + 'a,
T: ProcessSend + 'a,
[src]
&self,
work: F
) -> BoxFuture<'a, Result<T, Box<dyn Error + Send>>> where
F: FnOnce(&Self::ThreadPool) -> Fut + ProcessSend + 'a,
Fut: Future<Output = T> + 'a,
T: ProcessSend + 'a,