[−][src]Struct spirit_tokio::installer::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 arePin<Box<dyn Future<Output = ()> + Send>>
, created byBox::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]
fn clone(&self) -> FutureInstaller
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for FutureInstaller
[src]
impl Debug for FutureInstaller
[src]
impl Default for FutureInstaller
[src]
fn default() -> FutureInstaller
[src]
impl<F, O, C> Installer<F, O, C> for FutureInstaller where
F: Future<Output = ()> + Send + 'static,
[src]
F: Future<Output = ()> + Send + 'static,
type UninstallHandle = RemoteDrop
A handle representing lifetime of the resource. Read more
fn install(&mut self, fut: F, name: &'static str) -> RemoteDrop
[src]
fn init<E>(&mut self, ext: E, _name: &'static str) -> Result<E, AnyError> where
E: Extensible<Opts = O, Config = C, Ok = E>,
E::Config: DeserializeOwned + Send + Sync + 'static,
E::Opts: StructOpt + Send + Sync + 'static,
[src]
E: Extensible<Opts = O, Config = C, Ok = E>,
E::Config: DeserializeOwned + Send + Sync + 'static,
E::Opts: StructOpt + Send + Sync + 'static,
Auto Trait Implementations
impl RefUnwindSafe for FutureInstaller
impl Send for FutureInstaller
impl Sync for FutureInstaller
impl Unpin for FutureInstaller
impl UnwindSafe for FutureInstaller
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoResult<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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>,