[][src]Struct fumio::Runtime

pub struct Runtime { /* fields omitted */ }

Runtime

When running/entered it supports the following subsystems:

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]

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]

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]

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]

impl LocalSpawn for Runtime[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]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<Sp> SpawnExt for Sp where
    Sp: Spawn + ?Sized
[src]

fn spawn<Fut>(&mut self, future: Fut) -> Result<(), SpawnError> where
    Fut: Future<Output = ()> + Send + 'static, 
[src]

Spawns a task that polls the given future with output () to completion. Read more

impl<Sp> LocalSpawnExt for Sp where
    Sp: LocalSpawn + ?Sized
[src]

fn spawn_local<Fut>(&mut self, future: Fut) -> Result<(), SpawnError> where
    Fut: Future<Output = ()> + 'static, 
[src]

Spawns a task that polls the given future with output () to completion. Read more