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