Trait App

Source
pub trait App<AppEv, AppMetric> {
    type AppConfig: Config;
    type Setup;

    // Required methods
    fn name(&self) -> &'static str;
    fn setup<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        wora: &'life1 Wora<AppEv, AppMetric>,
        exec: impl 'async_trait + AsyncExecutor<AppEv, AppMetric>,
        fs: impl 'async_trait + WFS,
        metrics: Sender<O11yEvent<AppMetric>>,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Setup, Box<dyn Error>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn main<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        wora: &'life1 mut Wora<AppEv, AppMetric>,
        exec: impl 'async_trait + AsyncExecutor<AppEv, AppMetric>,
        fs: impl 'async_trait + WFS,
        metrics: Sender<O11yEvent<AppMetric>>,
    ) -> Pin<Box<dyn Future<Output = MainRetryAction> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn is_healthy<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = HealthState> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn end<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        wora: &'life1 Wora<AppEv, AppMetric>,
        exec: impl 'async_trait + AsyncExecutor<AppEv, AppMetric>,
        fs: impl 'async_trait + WFS,
        metrics: Sender<O11yEvent<AppMetric>>,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided method
    fn allow_concurrent_executions(&self) -> bool { ... }
}

Required Associated Types§

Required Methods§

Source

fn name(&self) -> &'static str

Source

fn setup<'life0, 'life1, 'async_trait>( &'life0 mut self, wora: &'life1 Wora<AppEv, AppMetric>, exec: impl 'async_trait + AsyncExecutor<AppEv, AppMetric>, fs: impl 'async_trait + WFS, metrics: Sender<O11yEvent<AppMetric>>, ) -> Pin<Box<dyn Future<Output = Result<Self::Setup, Box<dyn Error>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn main<'life0, 'life1, 'async_trait>( &'life0 mut self, wora: &'life1 mut Wora<AppEv, AppMetric>, exec: impl 'async_trait + AsyncExecutor<AppEv, AppMetric>, fs: impl 'async_trait + WFS, metrics: Sender<O11yEvent<AppMetric>>, ) -> Pin<Box<dyn Future<Output = MainRetryAction> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn is_healthy<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = HealthState> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn end<'life0, 'life1, 'async_trait>( &'life0 mut self, wora: &'life1 Wora<AppEv, AppMetric>, exec: impl 'async_trait + AsyncExecutor<AppEv, AppMetric>, fs: impl 'async_trait + WFS, metrics: Sender<O11yEvent<AppMetric>>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Provided Methods§

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§