pub struct RabiaEngine<SM, NT, PL>{ /* private fields */ }Implementations§
Source§impl<SM, NT, PL> RabiaEngine<SM, NT, PL>
impl<SM, NT, PL> RabiaEngine<SM, NT, PL>
pub fn new( node_id: NodeId, config: RabiaConfig, cluster_config: ClusterConfig, state_machine: SM, network: NT, persistence: PL, command_rx: EngineCommandReceiver, ) -> Self
Source§impl<SM, PL> RabiaEngine<SM, TcpNetwork, PL>where
SM: StateMachine + 'static,
PL: PersistenceLayer + 'static,
impl<SM, PL> RabiaEngine<SM, TcpNetwork, PL>where
SM: StateMachine + 'static,
PL: PersistenceLayer + 'static,
Sourcepub async fn new_with_tcp(
node_id: NodeId,
config: RabiaConfig,
cluster_config: ClusterConfig,
state_machine: SM,
persistence: PL,
command_rx: EngineCommandReceiver,
) -> Result<Self>
pub async fn new_with_tcp( node_id: NodeId, config: RabiaConfig, cluster_config: ClusterConfig, state_machine: SM, persistence: PL, command_rx: EngineCommandReceiver, ) -> Result<Self>
Create a new RabiaEngine with integrated TCP networking
Source§impl<SM, NT, PL> RabiaEngine<SM, NT, PL>
impl<SM, NT, PL> RabiaEngine<SM, NT, PL>
Sourcepub fn get_leader(&self) -> Option<NodeId>
pub fn get_leader(&self) -> Option<NodeId>
Get the current leader node ID
Sourcepub fn get_leadership_info(&self) -> LeadershipInfo
pub fn get_leadership_info(&self) -> LeadershipInfo
Get current leadership information
Sourcepub fn update_cluster_membership(
&mut self,
nodes: HashSet<NodeId>,
) -> Option<NodeId>
pub fn update_cluster_membership( &mut self, nodes: HashSet<NodeId>, ) -> Option<NodeId>
Update cluster membership and determine new leader
pub async fn run(self) -> Result<()>
Trait Implementations§
Source§impl<SM, NT, PL> NetworkEventHandler for RabiaEngine<SM, NT, PL>
impl<SM, NT, PL> NetworkEventHandler for RabiaEngine<SM, NT, PL>
fn on_node_connected<'life0, 'async_trait>(
&'life0 self,
node_id: NodeId,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_node_disconnected<'life0, 'async_trait>(
&'life0 self,
node_id: NodeId,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_network_partition<'life0, 'async_trait>(
&'life0 self,
active_nodes: HashSet<NodeId>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_quorum_lost<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_quorum_restored<'life0, 'async_trait>(
&'life0 self,
active_nodes: HashSet<NodeId>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl<SM, NT, PL> Freeze for RabiaEngine<SM, NT, PL>
impl<SM, NT, PL> !RefUnwindSafe for RabiaEngine<SM, NT, PL>
impl<SM, NT, PL> Send for RabiaEngine<SM, NT, PL>
impl<SM, NT, PL> Sync for RabiaEngine<SM, NT, PL>
impl<SM, NT, PL> Unpin for RabiaEngine<SM, NT, PL>
impl<SM, NT, PL> !UnwindSafe for RabiaEngine<SM, NT, PL>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more