pub trait NodeBuilder<N: Node>: Sized {
    type Error: Error;
    type Config;

    fn new(config: Self::Config) -> Result<Self, Self::Error>;
    fn with_worker<W: Worker<N> + 'static>(self) -> Self
    where
        W::Config: Default
; fn with_worker_cfg<W: Worker<N> + 'static>(self, config: W::Config) -> Self; fn with_resource<R: Any + Send + Sync>(self, res: R) -> Self; fn finish<'async_trait>(
        self
    ) -> Pin<Box<dyn Future<Output = Result<N, Self::Error>> + 'async_trait>>
    where
        Self: 'async_trait
; }
Expand description

A trait that provides generic build configuration capabilities for a node.

Required Associated Types

The type of errors that may be emitted as a result of the build process.

Global configuration provided to the node on creation.

Required Methods

Begin building a new node with the provided configuration state.

Register a worker, with default configuration state, that should be started with the node.

Register a worker, with the given configuration state, that should be started with the node.

Provide a resource that should be registered with the node upon start.

Finish building the node, returning the final node.

Implementors