[][src]Struct abscissa_tokio::TokioComponent

pub struct TokioComponent { /* fields omitted */ }

Component which manages initialization of a Tokio runtime within the Abscissa application lifecycle.

See this crate's toplevel documentation for detailed usage notes.

Methods

impl TokioComponent[src]

pub fn new() -> Result<Self, FrameworkError>[src]

Create a new Tokio runtime component with the default options

pub fn runtime(&self) -> Result<&Runtime, FrameworkError>[src]

Borrow the runtime, to e.g. ::spawn a future on it.

Returns an error if the runtime has already been taken.

pub fn runtime_mut(&mut self) -> Result<&mut Runtime, FrameworkError>[src]

Borrow the runtime mutably (e.g. to block_on it during startup).

NOTE: If you are trying to transfer control of your application to the Tokio runtime, use the abscissa_tokio::run function instead.

Returns an error if the runtime has already been taken.

Trait Implementations

impl<A> Component<A> for TokioComponent where
    A: Application
[src]

fn id(&self) -> Id[src]

Identifier for this component

fn version(&self) -> Version[src]

Version of this component

impl Debug for TokioComponent[src]

impl From<Runtime> for TokioComponent[src]

Auto Trait Implementations

Blanket Implementations

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

impl<T> AsAny for T where
    T: Any
[src]

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

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

impl<T> Erased for T

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.