[−][src]Struct abscissa_tokio::TokioComponent
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]
A: Application,
fn id(&self) -> Id
[src]
Identifier for this component
fn version(&self) -> Version
[src]
Version of this component
fn after_config(
&mut self,
config: &<A as Application>::Cfg
) -> Result<(), FrameworkError>
[src]
&mut self,
config: &<A as Application>::Cfg
) -> Result<(), FrameworkError>
fn dependencies(&self) -> Iter<Id>
[src]
fn register_dependency(
&mut self,
handle: Handle,
dependency: &mut (dyn Component<A> + 'static)
) -> Result<(), FrameworkError>
[src]
&mut self,
handle: Handle,
dependency: &mut (dyn Component<A> + 'static)
) -> Result<(), FrameworkError>
fn before_shutdown(&self, kind: Shutdown) -> Result<(), FrameworkError>
[src]
impl Debug for TokioComponent
[src]
impl From<Runtime> for TokioComponent
[src]
Auto Trait Implementations
impl !RefUnwindSafe for TokioComponent
impl Send for TokioComponent
impl Sync for TokioComponent
impl Unpin for TokioComponent
impl !UnwindSafe for TokioComponent
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> AsAny for T where
T: Any,
[src]
T: Any,
fn as_any(&self) -> &(dyn Any + 'static)
[src]
fn as_mut_any(&mut self) -> &mut (dyn Any + 'static)
[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> Erased for T
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>,