[−][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>>
The future returned from the initialize function
Required methods
fn initialize(
&mut self,
executor: Handle,
handles_fut: ServiceHandlesFuture,
shutdown: ShutdownSignal
) -> Self::Future
&mut self,
executor: Handle,
handles_fut: ServiceHandlesFuture,
shutdown: ShutdownSignal
) -> Self::Future
Async initialization code for a service
Provided methods
fn boxed(self) -> BoxedServiceInitializer where
Self: Sized + Send + 'static,
Self::Future: Send + 'static,
Self: Sized + Send + 'static,
Self::Future: Send + 'static,
Create a boxed version of this ServiceInitializer.
Implementors
impl<TFunc, TFut> ServiceInitializer for TFunc where
TFunc: FnMut(Handle, ServiceHandlesFuture, ShutdownSignal) -> TFut,
TFut: Future<Output = Result<(), ServiceInitializationError>>,
[src]
TFunc: FnMut(Handle, ServiceHandlesFuture, ShutdownSignal) -> 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:
ⓘThis code runs with edition 2018
let my_initializer = |executor: runtime::Handle, handles_fut: ServiceHandlesFuture| { // initialization code futures::future::ready(Result::<_, ()>::Ok(())) };
type Future = TFut
fn initialize(
&mut self,
executor: Handle,
handles: ServiceHandlesFuture,
shutdown: ShutdownSignal
) -> Self::Future
[src]
&mut self,
executor: Handle,
handles: ServiceHandlesFuture,
shutdown: ShutdownSignal
) -> Self::Future