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

pub struct FutureInstaller;
Expand description

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

A handle representing lifetime of the resource. Read more

Installs another instance of the resource. Read more

Initialize the installer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Turns self into the result.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.