Struct tokio::runtime::current_thread::TaskExecutor
source · [−]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
sourceimpl 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 = ()> + 'static, Global>
) -> Result<(), SpawnError>
pub fn spawn_local(
&mut self,
future: Box<dyn Future<Item = (), Error = ()> + 'static, Global>
) -> Result<(), SpawnError>
Spawn a future onto the current CurrentThread
instance.
Trait Implementations
sourceimpl Clone for TaskExecutor
impl Clone for TaskExecutor
sourcepub fn clone(&self) -> TaskExecutor
pub fn clone(&self) -> TaskExecutor
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for TaskExecutor
impl Debug for TaskExecutor
sourceimpl Executor for TaskExecutor
impl Executor for TaskExecutor
sourceimpl<F> TypedExecutor<F> for TaskExecutor where
F: Future<Item = (), Error = ()> + 'static,
impl<F> TypedExecutor<F> for TaskExecutor where
F: Future<Item = (), Error = ()> + 'static,
Auto Trait Implementations
impl RefUnwindSafe for TaskExecutor
impl !Send for TaskExecutor
impl !Sync for TaskExecutor
impl Unpin for TaskExecutor
impl UnwindSafe for TaskExecutor
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more