[−][src]Struct concorde::Participant
Participant
s represent parties participating in lattice agreement. They
support a low-level, explicit-state-machine interface that must be manually
initialized and stepped, with each step consuming input messages, producing
output messages, and possibly performing a state transition. When complete,
a final proposal-agreement value can be read out of the Participant.
Note that unlike in a full consensus system, the response from propose
is
not guaranteed to be equal at all Participant
s, nor is it guaranteed to
even be a value any Participant
proposed.
(The exact guarantees on the proposal, its response, and its relationships to other proposals and responses on other peers are somewhat subtle, see the paper.)
Responsibility for routing Message::Request
s and Message::Response
s to
their destination Peer
s is left to the client of this library, as is
responsibility for distributing broadcast Message::Commit
s.
All such communication is assumed to be (eventually) reliable, though no
timing assumptions are made. Lost messages, or a sufficient number of
quorum-peer failures, may cause Participant
s to get stuck. If this is
a concern, the state machine should be embedded in a higher-level retry
protocol that uses timeouts to ensure eventual delivery.
Fields
id: Peer
final_state: Option<StateLE<ObjLD, Peer>>
Implementations
impl<ObjLD: LatticeDef + 'static, Peer: Ord + Clone + Debug + Hash + 'static> Participant<ObjLD, Peer> where
ObjLD::T: Clone + Debug + Default,
[src]
ObjLD::T: Clone + Debug + Default,
pub fn new(id: Peer) -> Self
[src]
pub fn propose_step<'a, MI>(
&mut self,
incoming: MI,
outgoing: &mut Vec<Message<ObjLD, Peer>>
) where
MI: Iterator<Item = &'a Message<ObjLD, Peer>>,
[src]
&mut self,
incoming: MI,
outgoing: &mut Vec<Message<ObjLD, Peer>>
) where
MI: Iterator<Item = &'a Message<ObjLD, Peer>>,
pub fn propose_is_fini(&self) -> bool
[src]
Returns true iff the participant's proposal state-machine is fini.
pub fn propose(&mut self, prop: &StateLE<ObjLD, Peer>)
[src]
Starts a new proposal, resetting necessary state, so can be called at any time,
Trait Implementations
impl<ObjLD: LatticeDef, Peer: Ord + Clone + Debug + Hash> Clone for Participant<ObjLD, Peer> where
ObjLD::T: Clone + Debug + Default,
[src]
ObjLD::T: Clone + Debug + Default,
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<ObjLD: Debug + LatticeDef, Peer: Debug + Ord + Clone + Hash> Debug for Participant<ObjLD, Peer> where
ObjLD::T: Clone + Debug + Default,
[src]
ObjLD::T: Clone + Debug + Default,
impl<ObjLD: LatticeDef, Peer: Ord + Clone + Debug + Hash> Hash for Participant<ObjLD, Peer> where
ObjLD::T: Clone + Debug + Default + Hash,
[src]
ObjLD::T: Clone + Debug + Default + Hash,
Auto Trait Implementations
impl<ObjLD, Peer> RefUnwindSafe for Participant<ObjLD, Peer> where
Peer: RefUnwindSafe,
<ObjLD as LatticeDef>::T: RefUnwindSafe,
Peer: RefUnwindSafe,
<ObjLD as LatticeDef>::T: RefUnwindSafe,
impl<ObjLD, Peer> Send for Participant<ObjLD, Peer> where
Peer: Send + Sync,
<ObjLD as LatticeDef>::T: Send,
Peer: Send + Sync,
<ObjLD as LatticeDef>::T: Send,
impl<ObjLD, Peer> Sync for Participant<ObjLD, Peer> where
Peer: Send + Sync,
<ObjLD as LatticeDef>::T: Sync,
Peer: Send + Sync,
<ObjLD as LatticeDef>::T: Sync,
impl<ObjLD, Peer> Unpin for Participant<ObjLD, Peer> where
Peer: Unpin,
<ObjLD as LatticeDef>::T: Unpin,
Peer: Unpin,
<ObjLD as LatticeDef>::T: Unpin,
impl<ObjLD, Peer> UnwindSafe for Participant<ObjLD, Peer> where
Peer: RefUnwindSafe + UnwindSafe,
<ObjLD as LatticeDef>::T: UnwindSafe,
Peer: RefUnwindSafe + UnwindSafe,
<ObjLD as LatticeDef>::T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,