[−][src]Struct tokio::runtime::current_thread::Handle
Handle to spawn a future on the corresponding CurrentThread
runtime instance
Methods
impl Handle
[src]
pub fn spawn<F>(&self, future: F) -> Result<(), SpawnError> where
F: Future<Item = (), Error = ()> + Send + 'static,
[src]
F: Future<Item = (), Error = ()> + Send + 'static,
Spawn a future onto the CurrentThread
runtime instance corresponding to this handle
Panics
This function panics if the spawn fails. Failure occurs if the CurrentThread
instance of the Handle
does not exist anymore.
pub fn status(&self) -> Result<(), SpawnError>
[src]
Provides a best effort hint to whether or not spawn
will succeed.
This function may return both false positives and false negatives.
If status
returns Ok
, then a call to spawn
will probably
succeed, but may fail. If status
returns Err
, a call to spawn
will
probably fail, but may succeed.
This allows a caller to avoid creating the task if the call to spawn
has a high likelihood of failing.
Trait Implementations
impl Clone for Handle
[src]
impl Debug for Handle
[src]
impl<T> Executor<T> for Handle where
T: Future<Item = (), Error = ()> + Send + 'static,
[src]
T: Future<Item = (), Error = ()> + Send + 'static,
fn execute(&self, future: T) -> Result<(), ExecuteError<T>>
[src]
impl<T> TypedExecutor<T> for Handle where
T: Future<Item = (), Error = ()> + Send + 'static,
[src]
T: Future<Item = (), Error = ()> + Send + 'static,
fn spawn(&mut self, future: T) -> Result<(), SpawnError>
[src]
fn status(&self) -> Result<(), SpawnError>
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Handle
impl Send for Handle
impl !Sync for Handle
impl Unpin for Handle
impl !UnwindSafe for Handle
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>,