[][src]Struct tari_service_framework::StackBuilder

pub struct StackBuilder { /* fields omitted */ }

Responsible for building and collecting handles and (usually long-running) service futures. finish is an async function which resolves once all the services are initialized, or returns an error if any one of the services fails to initialize.

Implementations

impl StackBuilder[src]

pub fn new(shutdown_signal: ShutdownSignal) -> Self[src]

impl StackBuilder[src]

pub fn add_initializer<I>(self, initializer: I) -> Self where
    I: ServiceInitializer + Send + 'static,
    I::Future: Send + 'static, 
[src]

Add an impl of ServiceInitializer to the stack

pub fn add_initializer_fn<TFunc, TFut>(self, initializer: TFunc) -> Self where
    TFunc: FnOnce(ServiceInitializerContext) -> TFut + Send + 'static,
    TFut: Future<Output = Result<(), ServiceInitializationError>> + Send + 'static, 
[src]

Add an impl of ServiceInitializer to the stack

pub fn add_initializer_boxed(
    mut self: Self,
    initializer: BoxedServiceInitializer
) -> Self
[src]

Add a ServiceInitializer which has been boxed using ServiceInitializer::boxed

pub async fn build(self) -> Result<ServiceHandles, ServiceInitializationError>[src]

Concurrently initialize the services. Once all service have been initialized, notify_ready is called, which completes initialization for those services. The resulting service handles are returned. If ANY of the services fail to initialize, an error is returned.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.