[][src]Struct concorde::Participant

pub struct Participant<ObjLD: LatticeDef, Peer: Ord + Clone + Debug + Hash> where
    ObjLD::T: Clone + Debug + Default
{ pub id: Peer, pub final_state: Option<StateLE<ObjLD, Peer>>, // some fields omitted }

Participants 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 Participants, 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::Requests and Message::Responses to their destination Peers is left to the client of this library, as is responsibility for distributing broadcast Message::Commits.

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 Participants 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: Peerfinal_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]

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]

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]

impl<ObjLD: Debug + LatticeDef, Peer: Debug + Ord + Clone + Hash> Debug for Participant<ObjLD, Peer> where
    ObjLD::T: Clone + Debug + Default
[src]

impl<ObjLD: LatticeDef, Peer: Ord + Clone + Debug + Hash> Hash for Participant<ObjLD, Peer> where
    ObjLD::T: Clone + Debug + Default + Hash
[src]

Auto Trait Implementations

impl<ObjLD, Peer> RefUnwindSafe for Participant<ObjLD, Peer> where
    Peer: RefUnwindSafe,
    <ObjLD as LatticeDef>::T: RefUnwindSafe

impl<ObjLD, Peer> Send for Participant<ObjLD, Peer> where
    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

impl<ObjLD, Peer> Unpin for Participant<ObjLD, Peer> where
    Peer: Unpin,
    <ObjLD as LatticeDef>::T: Unpin

impl<ObjLD, Peer> UnwindSafe for Participant<ObjLD, Peer> where
    Peer: RefUnwindSafe + UnwindSafe,
    <ObjLD as LatticeDef>::T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.