pub struct ScheduledThreadPool { /* private fields */ }
Expand description
A thread pool that can schedule tasks to run after a given delay, or to execute periodically. Delayed tasks do not run before their associated delays, but besides that, there are no real-time guarantees about exactly when the task will run.
Implementations§
Source§impl ScheduledThreadPool
impl ScheduledThreadPool
pub fn fixed_size(size: u32) -> ScheduledThreadPool
pub fn single_thread() -> ScheduledThreadPool
pub fn schedule_ms<T: Task + 'static>(&self, delay: u32, task: T)
Trait Implementations§
Source§impl Clone for ScheduledThreadPool
impl Clone for ScheduledThreadPool
Source§fn clone(&self) -> ScheduledThreadPool
fn clone(&self) -> ScheduledThreadPool
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for ScheduledThreadPool
impl !RefUnwindSafe for ScheduledThreadPool
impl Send for ScheduledThreadPool
impl Sync for ScheduledThreadPool
impl Unpin for ScheduledThreadPool
impl !UnwindSafe for ScheduledThreadPool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more