[−][src]Struct tokio::runtime::current_thread::TaskExecutor
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.
Methods
impl TaskExecutor
[src]
pub fn current() -> TaskExecutor
[src]
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.
pub fn spawn_local(
&mut self,
future: Box<dyn Future<Error = (), Item = ()> + 'static>
) -> Result<(), SpawnError>
[src]
&mut self,
future: Box<dyn Future<Error = (), Item = ()> + 'static>
) -> Result<(), SpawnError>
Spawn a future onto the current CurrentThread
instance.
Trait Implementations
impl Clone for TaskExecutor
[src]
fn clone(&self) -> TaskExecutor
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for TaskExecutor
[src]
impl<F> Executor<F> for TaskExecutor where
F: Future<Item = (), Error = ()> + 'static,
[src]
F: Future<Item = (), Error = ()> + 'static,
fn execute(&self, future: F) -> Result<(), ExecuteError<F>>
[src]
impl Executor for TaskExecutor
[src]
fn spawn(
&mut self,
future: Box<dyn Future<Error = (), Item = ()> + 'static + Send>
) -> Result<(), SpawnError>
[src]
&mut self,
future: Box<dyn Future<Error = (), Item = ()> + 'static + Send>
) -> Result<(), SpawnError>
fn status(&self) -> Result<(), SpawnError>
[src]
impl<F> TypedExecutor<F> for TaskExecutor where
F: Future<Item = (), Error = ()> + 'static,
[src]
F: Future<Item = (), Error = ()> + 'static,
fn spawn(&mut self, future: F) -> Result<(), SpawnError>
[src]
fn status(&self) -> Result<(), SpawnError>
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,