datacake_node/extension.rs
1use async_trait::async_trait;
2
3use crate::DatacakeNode;
4
5#[async_trait]
6/// An extension of the base node/cluster.
7///
8/// This can be used to extend a base node to include additional
9/// functionality, like the eventually consistent store, multi-raft cluster
10/// or anything else which may want to use the membership, rpc and clock system.
11pub trait ClusterExtension {
12 type Output;
13 type Error;
14
15 async fn init_extension(
16 self,
17 node: &DatacakeNode,
18 ) -> Result<Self::Output, Self::Error>;
19}