Trait PaxosLike

Source
pub trait PaxosLike<'a>: Sized {
    type PaxosIn: 'a;
    type PaxosLog: 'a;
    type PaxosOut: 'a;
    type Ballot: Clone + Ord + Debug + Serialize + DeserializeOwned;

    // Required methods
    fn payload_recipients(&self) -> &Cluster<'a, Self::PaxosIn>;
    fn log_stores(&self) -> &Cluster<'a, Self::PaxosLog>;
    fn get_recipient_from_ballot<L: Location<'a>>(
        ballot: Optional<Self::Ballot, L, Unbounded>,
    ) -> Optional<ClusterId<Self::PaxosIn>, L, Unbounded>;
    unsafe fn build<P: PaxosPayload>(
        self,
        payload_generator: impl FnOnce(Stream<Self::Ballot, Cluster<'a, Self::PaxosIn>, Unbounded>) -> Stream<P, Cluster<'a, Self::PaxosIn>, Unbounded>,
        checkpoints: Optional<usize, Cluster<'a, Self::PaxosLog>, Unbounded>,
    ) -> Stream<(usize, Option<P>), Cluster<'a, Self::PaxosOut>, Unbounded, NoOrder>;

    // Provided method
    unsafe fn with_client<C: 'a, P: PaxosPayload>(
        self,
        clients: &Cluster<'a, C>,
        payloads: Stream<P, Cluster<'a, C>, Unbounded>,
        checkpoints: Optional<usize, Cluster<'a, Self::PaxosLog>, Unbounded>,
    ) -> Stream<(usize, Option<P>), Cluster<'a, Self::PaxosOut>, Unbounded, NoOrder> { ... }
}

Required Associated Types§

Source

type PaxosIn: 'a

The nodes that receive inputs in Paxos. Usually the proposers.

Source

type PaxosLog: 'a

The nodes that store logs in Paxos. Usually the acceptors.

Source

type PaxosOut: 'a

The nodes that output the results of Paxos. Proposers in Paxos, Proxy leaders in Compartmentalized Paxos.

Source

type Ballot: Clone + Ord + Debug + Serialize + DeserializeOwned

Required Methods§

Source

fn payload_recipients(&self) -> &Cluster<'a, Self::PaxosIn>

Source

fn log_stores(&self) -> &Cluster<'a, Self::PaxosLog>

Source

fn get_recipient_from_ballot<L: Location<'a>>( ballot: Optional<Self::Ballot, L, Unbounded>, ) -> Optional<ClusterId<Self::PaxosIn>, L, Unbounded>

Source

unsafe fn build<P: PaxosPayload>( self, payload_generator: impl FnOnce(Stream<Self::Ballot, Cluster<'a, Self::PaxosIn>, Unbounded>) -> Stream<P, Cluster<'a, Self::PaxosIn>, Unbounded>, checkpoints: Optional<usize, Cluster<'a, Self::PaxosLog>, Unbounded>, ) -> Stream<(usize, Option<P>), Cluster<'a, Self::PaxosOut>, Unbounded, NoOrder>

§Safety

During leader-reelection, the latest known leader may be stale, which may result in non-deterministic dropping of payloads.

Provided Methods§

Source

unsafe fn with_client<C: 'a, P: PaxosPayload>( self, clients: &Cluster<'a, C>, payloads: Stream<P, Cluster<'a, C>, Unbounded>, checkpoints: Optional<usize, Cluster<'a, Self::PaxosLog>, Unbounded>, ) -> Stream<(usize, Option<P>), Cluster<'a, Self::PaxosOut>, Unbounded, NoOrder>

§Safety

During leader-reelection, the latest known leader may be stale, which may result in non-deterministic dropping of payloads.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§