Struct irox_threading::CurrentThreadExecutor
source · pub struct CurrentThreadExecutor<'a> { /* private fields */ }
Expand description
An Executor that doesn’t spawn new threads, just runs on the current thread.
Implementations§
source§impl<'a> CurrentThreadExecutor<'a>
impl<'a> CurrentThreadExecutor<'a>
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new CurrentThreadExecutor
sourcepub fn submit<T: 'a>(
&mut self,
fut: impl Future<Output = T> + 'a
) -> LocalTaskHandle<T>
pub fn submit<T: 'a>( &mut self, fut: impl Future<Output = T> + 'a ) -> LocalTaskHandle<T>
Submit a new task to this executor. Note: This does not immediately run the task, you
still need to call either CurrentThreadExecutor::run_some
or
CurrentThreadExecutor::run_until_complete
sourcepub fn run_some(&mut self)
pub fn run_some(&mut self)
Runs a single loop through the processing queue, in order, letting each task attempt to do work.
sourcepub fn run_until_complete(&mut self)
pub fn run_until_complete(&mut self)
Runs this executor until all submitted tasks are complete.
Trait Implementations§
source§impl<'a> Default for CurrentThreadExecutor<'a>
impl<'a> Default for CurrentThreadExecutor<'a>
source§fn default() -> CurrentThreadExecutor<'a>
fn default() -> CurrentThreadExecutor<'a>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for CurrentThreadExecutor<'a>
impl<'a> !Send for CurrentThreadExecutor<'a>
impl<'a> !Sync for CurrentThreadExecutor<'a>
impl<'a> Unpin for CurrentThreadExecutor<'a>
impl<'a> !UnwindSafe for CurrentThreadExecutor<'a>
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