Skip to main content

VecProgressEntry

Trait VecProgressEntry 

Source
pub trait VecProgressEntry {
    type Id: 'static + PartialEq;
    type Progress: Clone + Default + Ord;

    // Required methods
    fn id(&self) -> &Self::Id;
    fn progress(&self) -> &Self::Progress;
    fn progress_mut(&mut self) -> &mut Self::Progress;

    // Provided methods
    fn id_progress(&self) -> (&Self::Id, &Self::Progress) { ... }
    fn id_progress_owned(&self) -> (Self::Id, Self::Progress)
       where Self::Id: Clone { ... }
}
Expand description

Entry stored in VecProgress.

VecProgress only uses the ID and progress value. Other entry fields are application-owned state.

Required Associated Types§

Source

type Id: 'static + PartialEq

ID type of the entry.

Source

type Progress: Clone + Default + Ord

Ordered progress value type.

Required Methods§

Source

fn id(&self) -> &Self::Id

Return the ID this entry belongs to.

Source

fn progress(&self) -> &Self::Progress

Return the progress value used to calculate quorum acceptance.

Source

fn progress_mut(&mut self) -> &mut Self::Progress

Return the mutable progress value.

Provided Methods§

Source

fn id_progress(&self) -> (&Self::Id, &Self::Progress)

Return the ID and progress value as references.

Source

fn id_progress_owned(&self) -> (Self::Id, Self::Progress)
where Self::Id: Clone,

Return cloned ID and progress value.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<ID, Progress> VecProgressEntry for (ID, Progress)
where ID: 'static + PartialEq, Progress: Clone + Default + Ord,

Source§

type Id = ID

Source§

type Progress = Progress

Source§

fn id(&self) -> &Self::Id

Source§

fn progress(&self) -> &Self::Progress

Source§

fn progress_mut(&mut self) -> &mut Self::Progress

Implementors§

Source§

impl<ID, Val> VecProgressEntry for IdVal<ID, Val>
where ID: 'static + PartialEq, Val: Clone + Default + Ord,

Source§

type Id = ID

Source§

type Progress = Val