[−][src]Trait tari_service_framework::ServiceInitializer
Implementors of this trait will initialize a service
The StackBuilder
builds impls of this trait.
Associated Types
type Future: Future<Output = Result<(), ServiceInitializationError>>
[src]
The future returned from the initialize function
Required methods
fn initialize(&mut self, context: ServiceInitializerContext) -> Self::Future
[src]
Async initialization code for a service
Provided methods
fn boxed(self) -> BoxedServiceInitializer where
Self: Sized + Send + 'static,
Self::Future: Send + 'static,
[src]
Self: Sized + Send + 'static,
Self::Future: Send + 'static,
Create a boxed version of this ServiceInitializer.
Implementors
impl<T: Send + Sync + 'static> ServiceInitializer for RegisterHandle<T>
[src]
type Future = Ready<Result<(), ServiceInitializationError>>
fn initialize(&mut self, context: ServiceInitializerContext) -> Self::Future
[src]
impl<TFunc, TFut> ServiceInitializer for TFunc where
TFunc: FnMut(ServiceInitializerContext) -> TFut,
TFut: Future<Output = Result<(), ServiceInitializationError>>,
[src]
TFunc: FnMut(ServiceInitializerContext) -> TFut,
TFut: Future<Output = Result<(), ServiceInitializationError>>,
Implementation of ServiceInitializer for any function matching the signature of ServiceInitializer::initialize
This allows the following "short-hand" syntax to be used:
ⓘ
let my_initializer = |executor: runtime::Handle, context: ServiceInitializerContext| { // initialization code futures::future::ready(Result::<_, ()>::Ok(())) };