Struct spirit_tokio::installer::FutureInstaller[][src]

pub struct FutureInstaller;

An installer able to install (an uninstall) long-running futures.

This is an installer that can be used with Fragment that produce futures.

  • If the spirit does not contain a Tokio runtime yet, one (the default one) will be added as a singleton. Note that this has effect on how spirit manages lifetime of the application.
  • An uninstallation is performed by dropping canceling the future.
  • This works with both concrete types (implementing Future<Output = ()> + Send) and boxed ones. Note that the boxed ones are Pin<Box<dyn Future<Output = ()> + Send>>, created by Box::pin.

See the crate level examples for details how to use (the installer is used only as the associated type in the fragment implementation).

Trait Implementations

impl Clone for FutureInstaller[src]

impl Copy for FutureInstaller[src]

impl Debug for FutureInstaller[src]

impl Default for FutureInstaller[src]

impl<F, O, C> Installer<F, O, C> for FutureInstaller where
    F: Future<Output = ()> + Send + 'static, 
[src]

type UninstallHandle = RemoteDrop

A handle representing lifetime of the resource. Read more

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<T> IntoResult<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.