[][src]Trait rgb::service::TryService

pub trait TryService: Sized {
    type ErrorType: Error;
#[must_use]    pub fn try_run_loop<'async_trait>(
        self
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::ErrorType>> + Send + 'async_trait>>
    where
        Self: 'async_trait
; #[must_use] pub fn run_or_panic<'life0, 'async_trait>(
        self,
        service_name: &'life0 str
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: Send + 'async_trait
, { ... } }

Trait for simpler service implementation with run loops which may fail with TryService::ErrorType errors; otherwise they should never return

Associated Types

type ErrorType: Error[src]

Type of the error which is produced in case of service failure and is returned from the internal [try_run_loop()] procedure

Loading content...

Required methods

#[must_use]pub fn try_run_loop<'async_trait>(
    self
) -> Pin<Box<dyn Future<Output = Result<(), Self::ErrorType>> + Send + 'async_trait>> where
    Self: 'async_trait, 
[src]

Main failable run loop implementation. Must produce an error of type TryService::ErrorType or never return.

Loading content...

Provided methods

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

NB: Do not reimplement this one: the function keeps in check that if the failure happens during run loop, the program will panic reporting the failure. To implement the actual run loop please provide implementation for [try_run_loop()]

Loading content...

Implementors

impl TryService for Runtime[src]

type ErrorType = RuntimeError

Loading content...