Trait capitan_lib::services::IsolatedService[][src]

pub trait IsolatedService: Any {
    #[must_use]
    fn init<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Res<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn main<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Res<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn repeat<'life0, 'async_trait>(
        &'life0 mut self
    ) -> Pin<Box<dyn Future<Output = Res<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn catch<'life0, 'async_trait>(
        &'life0 mut self,
        error: Error
    ) -> Pin<Box<dyn Future<Output = Res<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn abort<'life0, 'async_trait>(
        &'life0 mut self,
        error: Error
    ) -> Pin<Box<dyn Future<Output = Res<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
; fn to_dyn(self) -> DynamicIsolatedService
    where
        Self: Sized + Sync + Send
, { ... } }

Isolated services are services that can’t be accessed from the outside. they are helpful as root services, services that hold other services.

Required methods

#[must_use]
fn init<'life0, 'async_trait>(
    &'life0 mut self
) -> Pin<Box<dyn Future<Output = Res<()>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

only runs once at the start

#[must_use]
fn main<'life0, 'async_trait>(
    &'life0 mut self
) -> Pin<Box<dyn Future<Output = Res<()>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

loops

#[must_use]
fn repeat<'life0, 'async_trait>(
    &'life0 mut self
) -> Pin<Box<dyn Future<Output = Res<()>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

runs after main if main or repeat did not return errors

#[must_use]
fn catch<'life0, 'async_trait>(
    &'life0 mut self,
    error: Error
) -> Pin<Box<dyn Future<Output = Res<()>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

runs after main if main returned an error

#[must_use]
fn abort<'life0, 'async_trait>(
    &'life0 mut self,
    error: Error
) -> Pin<Box<dyn Future<Output = Res<()>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

run if catch was not successful

Loading content...

Provided methods

fn to_dyn(self) -> DynamicIsolatedService where
    Self: Sized + Sync + Send
[src]

Loading content...

Implementors

impl IsolatedService for DynamicIsolatedService[src]

Loading content...