[−][src]Struct fumio::Runtime
Runtime
When running/entered it supports the following subsystems:
fumio::reactor::current()
, also automatically used byfumio::reactor::LazyHandle
fumio::pool::current_local()
tokio_timer::timer::TimerHandle::current()
Methods
impl Runtime
[src]
pub fn new() -> Result<Self>
[src]
Create new runtime
pub fn handle(&self) -> Handle
[src]
Handle to the runtime
pub fn spawn<F>(&self, future: F) where
F: Future<Output = ()> + 'static,
[src]
F: Future<Output = ()> + 'static,
Spawn future on runtime
pub fn spawn_local_obj(&self, future: LocalFutureObj<'static, ()>)
[src]
Spawn future object on runtime
pub fn enter_run_until<F, T>(&mut self, enter: &mut Enter, future: F) -> T where
F: Future<Output = T>,
[src]
F: Future<Output = T>,
Runs all the tasks in the pool until the given future completes.
The given spawner, spawn
, is used as the default spawner for any
newly-spawned tasks. You can route these additional tasks back into
the LocalPool
by using its spawner handle:
The function will block the calling thread only until the future f
completes; there may still be incomplete tasks in the pool, which will
be inert after the call completes, but can continue with further use of
one of the pool's run or poll methods. While the function is running,
however, all tasks in the pool will try to make progress.
pub fn run_until<F, T>(&mut self, future: F) -> T where
F: Future<Output = T>,
[src]
F: Future<Output = T>,
Runs all the tasks in the pool until the given future completes.
The given spawner, spawn
, is used as the default spawner for any
newly-spawned tasks. You can route these additional tasks back into
the LocalPool
by using its spawner handle:
The function will block the calling thread only until the future f
completes; there may still be incomplete tasks in the pool, which will
be inert after the call completes, but can continue with further use of
one of the pool's run or poll methods. While the function is running,
however, all tasks in the pool will try to make progress.
pub fn enter_run(&mut self, enter: &mut Enter)
[src]
Run all tasks in the pool to completion.
The function will block the calling thread until all tasks in the pool completed, including any spawned while running existing tasks.
pub fn run<F, T>(&mut self)
[src]
Run all tasks in the pool to completion.
The function will block the calling thread until all tasks in the pool completed, including any spawned while running existing tasks.
Trait Implementations
impl Debug for Runtime
[src]
impl Spawn for Runtime
[src]
fn spawn_obj(
&mut self,
future: FutureObj<'static, ()>
) -> Result<(), SpawnError>
[src]
&mut self,
future: FutureObj<'static, ()>
) -> Result<(), SpawnError>
fn status(&self) -> Result<(), SpawnError>
[src]
impl LocalSpawn for Runtime
[src]
fn spawn_local_obj(
&mut self,
future: LocalFutureObj<'static, ()>
) -> Result<(), SpawnError>
[src]
&mut self,
future: LocalFutureObj<'static, ()>
) -> Result<(), SpawnError>
fn status_local(&self) -> Result<(), SpawnError>
[src]
Auto Trait Implementations
impl !Send for Runtime
impl Unpin for Runtime
impl !Sync for Runtime
impl !UnwindSafe for Runtime
impl !RefUnwindSafe for Runtime
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<Sp> SpawnExt for Sp where
Sp: Spawn + ?Sized,
[src]
Sp: Spawn + ?Sized,
fn spawn<Fut>(&mut self, future: Fut) -> Result<(), SpawnError> where
Fut: Future<Output = ()> + Send + 'static,
[src]
Fut: Future<Output = ()> + Send + 'static,
Spawns a task that polls the given future with output ()
to completion. Read more
impl<Sp> LocalSpawnExt for Sp where
Sp: LocalSpawn + ?Sized,
[src]
Sp: LocalSpawn + ?Sized,
fn spawn_local<Fut>(&mut self, future: Fut) -> Result<(), SpawnError> where
Fut: Future<Output = ()> + 'static,
[src]
Fut: Future<Output = ()> + 'static,
Spawns a task that polls the given future with output ()
to completion. Read more