pub trait WiringLayer:
'static
+ Send
+ Sync {
type Input: FromContext;
type Output: IntoContext;
// Required methods
fn layer_name(&self) -> &'static str;
fn wire<'async_trait>(
self,
input: Self::Input,
) -> Pin<Box<dyn Future<Output = Result<Self::Output, WiringError>> + Send + 'async_trait>>
where Self: 'async_trait;
}Expand description
Wiring layer provides a way to customize the ZkStackService by
adding new tasks or resources to it.
Structures that implement this trait are advised to specify in doc comments which resources they use or add, and the list of tasks they add.
Required Associated Types§
type Input: FromContext
type Output: IntoContext
Required Methods§
Sourcefn layer_name(&self) -> &'static str
fn layer_name(&self) -> &'static str
Identifier of the wiring layer.
Sourcefn wire<'async_trait>(
self,
input: Self::Input,
) -> Pin<Box<dyn Future<Output = Result<Self::Output, WiringError>> + Send + 'async_trait>>where
Self: 'async_trait,
fn wire<'async_trait>(
self,
input: Self::Input,
) -> Pin<Box<dyn Future<Output = Result<Self::Output, WiringError>> + Send + 'async_trait>>where
Self: 'async_trait,
Performs the wiring process, e.g. adds tasks and resources to the node. This method will be called once during the node initialization.