pub struct ConsensusManager { /* private fields */ }Expand description
Distributed consensus mechanism
Implementations§
Source§impl ConsensusManager
impl ConsensusManager
pub fn new(quorum_size: usize) -> Self
Sourcepub fn register_node(&self, node_id: String)
pub fn register_node(&self, node_id: String)
Register a node in the consensus network
Sourcepub fn vote(&self, _decision: &str) -> bool
pub fn vote(&self, _decision: &str) -> bool
Vote on a decision (returns true if consensus reached)
Sourcepub fn stats(&self) -> ConsensusStats
pub fn stats(&self) -> ConsensusStats
Get consensus statistics
Trait Implementations§
Source§impl Clone for ConsensusManager
impl Clone for ConsensusManager
Source§fn clone(&self) -> ConsensusManager
fn clone(&self) -> ConsensusManager
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ConsensusManager
impl RefUnwindSafe for ConsensusManager
impl Send for ConsensusManager
impl Sync for ConsensusManager
impl Unpin for ConsensusManager
impl UnwindSafe for ConsensusManager
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)