pub struct TaskExecutor { /* private fields */ }
Expand description
Executes futures on the current thread.
All futures executed using this executor will be executed on the current
thread. As such, run
will wait for these futures to complete before
returning.
For more details, see the module level documentation.
Implementations§
Source§impl TaskExecutor
impl TaskExecutor
Sourcepub fn current() -> TaskExecutor
pub fn current() -> TaskExecutor
Returns an executor that executes futures on the current thread.
The user of TaskExecutor
must ensure that when a future is submitted,
that it is done within the context of a call to run
.
For more details, see the module level documentation.
Sourcepub fn spawn_local(
&mut self,
future: Box<dyn Future<Item = (), Error = ()>>,
) -> Result<(), SpawnError>
pub fn spawn_local( &mut self, future: Box<dyn Future<Item = (), Error = ()>>, ) -> Result<(), SpawnError>
Spawn a future onto the current CurrentThread
instance.
Trait Implementations§
Source§impl Clone for TaskExecutor
impl Clone for TaskExecutor
Source§fn clone(&self) -> TaskExecutor
fn clone(&self) -> TaskExecutor
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 moreSource§impl Debug for TaskExecutor
impl Debug for TaskExecutor
Source§impl<F> Executor<F> for TaskExecutor
impl<F> Executor<F> for TaskExecutor
Source§impl Executor for TaskExecutor
impl Executor for TaskExecutor
Source§impl<F> TypedExecutor<F> for TaskExecutor
impl<F> TypedExecutor<F> for TaskExecutor
Auto Trait Implementations§
impl Freeze for TaskExecutor
impl RefUnwindSafe for TaskExecutor
impl !Send for TaskExecutor
impl !Sync for TaskExecutor
impl Unpin for TaskExecutor
impl UnwindSafe for TaskExecutor
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)