InstanceTrait

Trait InstanceTrait 

Source
pub trait InstanceTrait:
    Any
    + Send
    + Sync {
    type Error: ErrorTrait;

    // Required method
    fn register<'life0, 'async_trait>(
        _: &'life0 Container,
    ) -> Pin<Box<dyn Future<Output = Result<Self, ContainerError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: Sized + 'async_trait;

    // Provided methods
    fn name() -> String { ... }
    fn boot<'async_trait>(    ) -> Pin<Box<dyn Future<Output = Result<(), ContainerError>> + Send + 'async_trait>>
       where Self: Sized + 'async_trait { ... }
    fn cleanup() -> Result<(), ContainerError> { ... }
    fn facade() -> &'static Self
       where Self: Sized { ... }
}

Required Associated Types§

Required Methods§

Source

fn register<'life0, 'async_trait>( _: &'life0 Container, ) -> Pin<Box<dyn Future<Output = Result<Self, ContainerError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: Sized + 'async_trait,

Provided Methods§

Source

fn name() -> String

Source

fn boot<'async_trait>() -> Pin<Box<dyn Future<Output = Result<(), ContainerError>> + Send + 'async_trait>>
where Self: Sized + 'async_trait,

Source

fn cleanup() -> Result<(), ContainerError>

Source

fn facade() -> &'static Self
where Self: Sized,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§