Struct thread_pool::Sender
[−]
[src]
pub struct Sender<T> { /* fields omitted */ }
A handle that allows dispatching work to a thread pool.
Methods
impl<T: Task> Sender<T>
[src]
fn send(&self, task: T) -> Result<(), SendError<T>>
Send a task to the thread pool, blocking if necessary
The function may result in spawning additional threads depending on the current state and configuration of the thread pool.
fn send_timeout(
&self,
task: T,
timeout: Duration
) -> Result<(), SendTimeoutError<T>>
&self,
task: T,
timeout: Duration
) -> Result<(), SendTimeoutError<T>>
Send a task to the thread pool, blocking if necessary for up to duration
fn try_send(&self, task: T) -> Result<(), TrySendError<T>>
Send a task to the thread pool, returning immediately if at capacity.
impl Sender<Box<TaskBox>>
[src]
fn send_fn<F>(&self, task: F) -> Result<(), SendError<Box<TaskBox>>> where
F: FnOnce() + Send + 'static,
F: FnOnce() + Send + 'static,
Send a fn to run on the thread pool, blocking if necessary
The function may result in spawning additional threads depending on the current state and configuration of the thread pool.
fn send_fn_timeout<F>(
&self,
task: F,
timeout: Duration
) -> Result<(), SendTimeoutError<Box<TaskBox>>> where
F: FnOnce() + Send + 'static,
&self,
task: F,
timeout: Duration
) -> Result<(), SendTimeoutError<Box<TaskBox>>> where
F: FnOnce() + Send + 'static,
Send a fn to run on the thread pool, blocking if necessary for up to
duration
fn try_send_fn<F>(&self, task: F) -> Result<(), TrySendError<Box<TaskBox>>> where
F: FnOnce() + Send + 'static,
F: FnOnce() + Send + 'static,
Send a fn to run on the thread pool, returning immediately if at capacity.
Trait Implementations
impl<T> Clone for Sender<T>
[src]
fn clone(&self) -> Self
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more