Struct tokio_scoped::Scope [−][src]
pub struct Scope<'a> { /* fields omitted */ }
Methods
impl<'a> Scope<'a>
[src]
impl<'a> Scope<'a>
pub fn spawn<'s, F>(&'s mut self, future: F) -> &mut Self where
F: Future<Item = (), Error = ()> + Send + 'a,
'a: 's,
[src]
pub fn spawn<'s, F>(&'s mut self, future: F) -> &mut Self where
F: Future<Item = (), Error = ()> + Send + 'a,
'a: 's,
Spawn the received future on the ScopedRuntime
which was used to create self
.
pub fn block_on<'s, R, E, F>(&'s mut self, future: F) -> Result<R, E> where
F: Future<Item = R, Error = E> + Send + 'a,
R: Send + 'a,
E: Send + 'a,
'a: 's,
[src]
pub fn block_on<'s, R, E, F>(&'s mut self, future: F) -> Result<R, E> where
F: Future<Item = R, Error = E> + Send + 'a,
R: Send + 'a,
E: Send + 'a,
'a: 's,
Blocks the "current thread" of the runtime until future
resolves. Other spawned futures
can make progress while this future is running.
pub fn scope<'inner, F, R>(&'inner self, f: F) -> R where
F: FnOnce(&mut Scope<'inner>) -> R,
'a: 'inner,
[src]
pub fn scope<'inner, F, R>(&'inner self, f: F) -> R where
F: FnOnce(&mut Scope<'inner>) -> R,
'a: 'inner,
Creates an inner
scope which can access variables created within the outer scope.
pub fn executor(&self) -> TaskExecutor
[src]
pub fn executor(&self) -> TaskExecutor
Get a TaskExecutor
to the underlying Runtime
instance.
Trait Implementations
impl<'a> Debug for Scope<'a>
[src]
impl<'a> Debug for Scope<'a>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<'a> Drop for Scope<'a>
[src]
impl<'a> Drop for Scope<'a>