pub struct Dispatcher { /* private fields */ }Expand description
Used to call futures from another thread, getting their output values via await.
Implementations§
Source§impl Dispatcher
impl Dispatcher
pub fn new() -> Self
Sourcepub fn run(&mut self)
pub fn run(&mut self)
Run all tasks in the pool to completion.
This method will not enqueue new tasks until the next call!
Sourcepub fn run_until_stalled(&mut self)
pub fn run_until_stalled(&mut self)
Runs all tasks in the pool and returns if no more progress can be made on any task.
This method will not enqueue new tasks until the next call!
Sourcepub fn try_run_one(&mut self) -> bool
pub fn try_run_one(&mut self) -> bool
Runs all tasks and returns after completing one future or until no more progress can be made. Returns true if one future was completed, false otherwise.
This method will not enqueue new tasks until the next call!
Sourcepub fn get_handle(&self) -> DispatcherHandle
pub fn get_handle(&self) -> DispatcherHandle
Get a DispatcherHandle to control this Dispatcher from another thread.
Sourcepub fn get_handle_local(&self) -> LocalDispatcherHandle
pub fn get_handle_local(&self) -> LocalDispatcherHandle
Get a LocalDispatcherHandle to control this Dispatcher from the same thread.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Dispatcher
impl !RefUnwindSafe for Dispatcher
impl !Send for Dispatcher
impl !Sync for Dispatcher
impl Unpin for Dispatcher
impl !UnwindSafe for Dispatcher
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