Skip to main content

IdVal

Struct IdVal 

Source
pub struct IdVal<ID, Val> {
    pub id: ID,
    pub val: Val,
}
Expand description

An ID and its associated value.

Fields§

§id: ID

Node ID.

§val: Val

Associated progress value.

Implementations§

Source§

impl<ID, Val> IdVal<ID, Val>

Source

pub fn new(id: ID, val: Val) -> Self

Create an IdVal with the provided ID and value.

Source§

impl<ID, Val> IdVal<ID, Val>
where Val: Default,

Source

pub fn new_default(id: ID) -> Self

Create an IdVal with the provided ID and Val::default().

Trait Implementations§

Source§

impl<ID: Clone, Val: Clone> Clone for IdVal<ID, Val>

Source§

fn clone(&self) -> IdVal<ID, Val>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<ID: Debug, Val: Debug> Debug for IdVal<ID, Val>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<ID, Val> Display for IdVal<ID, Val>
where ID: Display, Val: Display,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<ID: Eq, Val: Eq> Eq for IdVal<ID, Val>

Source§

impl<ID: PartialEq, Val: PartialEq> PartialEq for IdVal<ID, Val>

Source§

fn eq(&self, other: &IdVal<ID, Val>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<ID: PartialEq, Val: PartialEq> StructuralPartialEq for IdVal<ID, Val>

Source§

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

Source§

type Id = ID

ID type of the entry.
Source§

type Progress = Val

Ordered progress value type.
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.
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.

Auto Trait Implementations§

§

impl<ID, Val> Freeze for IdVal<ID, Val>
where ID: Freeze, Val: Freeze,

§

impl<ID, Val> RefUnwindSafe for IdVal<ID, Val>
where ID: RefUnwindSafe, Val: RefUnwindSafe,

§

impl<ID, Val> Send for IdVal<ID, Val>
where ID: Send, Val: Send,

§

impl<ID, Val> Sync for IdVal<ID, Val>
where ID: Sync, Val: Sync,

§

impl<ID, Val> Unpin for IdVal<ID, Val>
where ID: Unpin, Val: Unpin,

§

impl<ID, Val> UnsafeUnpin for IdVal<ID, Val>
where ID: UnsafeUnpin, Val: UnsafeUnpin,

§

impl<ID, Val> UnwindSafe for IdVal<ID, Val>
where ID: UnwindSafe, Val: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.