pub struct GeometricConsensus { /* private fields */ }Expand description
A geometric consensus protocol implementation
Implementations§
Source§impl GeometricConsensus
impl GeometricConsensus
Sourcepub async fn propose(&mut self, value: GA3) -> Result<(), Box<dyn Error>>
pub async fn propose(&mut self, value: GA3) -> Result<(), Box<dyn Error>>
Propose a value for consensus
Sourcepub async fn geometric_consensus(
&self,
proposals: &[GA3],
threshold: f64,
) -> Result<GA3, Box<dyn Error>>
pub async fn geometric_consensus( &self, proposals: &[GA3], threshold: f64, ) -> Result<GA3, Box<dyn Error>>
Compute consensus from a set of proposals using geometric algebra
Sourcepub async fn run_consensus_round(
&mut self,
proposal: GA3,
participants: &[Uuid],
) -> Result<Option<GA3>, Box<dyn Error>>
pub async fn run_consensus_round( &mut self, proposal: GA3, participants: &[Uuid], ) -> Result<Option<GA3>, Box<dyn Error>>
Run a full consensus round
Sourcepub async fn sync_crdt_state(
&self,
_other_node: Uuid,
) -> Result<(), Box<dyn Error>>
pub async fn sync_crdt_state( &self, _other_node: Uuid, ) -> Result<(), Box<dyn Error>>
Sync CRDT state with another node
Sourcepub async fn handle_sync_message(&self, crdt_state: GeometricCRDT)
pub async fn handle_sync_message(&self, crdt_state: GeometricCRDT)
Handle an incoming sync message
Sourcepub async fn get_current_state(&self) -> GA3
pub async fn get_current_state(&self) -> GA3
Get the current consensus state
Auto Trait Implementations§
impl Freeze for GeometricConsensus
impl !RefUnwindSafe for GeometricConsensus
impl Send for GeometricConsensus
impl Sync for GeometricConsensus
impl Unpin for GeometricConsensus
impl UnsafeUnpin for GeometricConsensus
impl !UnwindSafe for GeometricConsensus
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