[−][src]Trait rgb::service::TryService
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
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]
self
) -> Pin<Box<dyn Future<Output = Result<(), Self::ErrorType>> + Send + 'async_trait>> where
Self: 'async_trait,
Main failable run loop implementation. Must produce an error of type
TryService::ErrorType or never return.
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]
self,
service_name: &'life0 str
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: Send + 'async_trait,
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()]
Implementors
impl TryService for Runtime[src]
type ErrorType = RuntimeError
pub fn try_run_loop<'async_trait>(
self
) -> Pin<Box<dyn Future<Output = Result<(), RuntimeError>> + Send + 'async_trait>> where
Self: 'async_trait, [src]
self
) -> Pin<Box<dyn Future<Output = Result<(), RuntimeError>> + Send + 'async_trait>> where
Self: 'async_trait,