Enum libp2p::swarm::AddressScore
source · pub enum AddressScore {
Infinite,
Finite(u32),
}
Expand description
The “score” of an address w.r.t. an ordered collection of addresses.
A score is a measure of the trusworthyness of a particular observation of an address. The same address may be repeatedly reported with the same or differing scores.
Variants§
Infinite
The score is “infinite”, i.e. an address with this score is never
purged from the associated address records and remains sorted at
the beginning (possibly with other Infinite
ly scored addresses).
Finite(u32)
The score is finite, i.e. an address with this score has its score increased and decreased as per the frequency of reports (i.e. additions) of the same address relative to the reports of other addresses.
Trait Implementations§
source§impl Add<AddressScore> for AddressScore
impl Add<AddressScore> for AddressScore
§type Output = AddressScore
type Output = AddressScore
The resulting type after applying the
+
operator.source§fn add(self, rhs: AddressScore) -> <AddressScore as Add<AddressScore>>::Output
fn add(self, rhs: AddressScore) -> <AddressScore as Add<AddressScore>>::Output
Performs the
+
operation. Read moresource§impl Clone for AddressScore
impl Clone for AddressScore
source§fn clone(&self) -> AddressScore
fn clone(&self) -> AddressScore
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for AddressScore
impl Debug for AddressScore
source§impl Hash for AddressScore
impl Hash for AddressScore
source§impl Ord for AddressScore
impl Ord for AddressScore
source§fn cmp(&self, other: &AddressScore) -> Ordering
fn cmp(&self, other: &AddressScore) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<AddressScore> for AddressScore
impl PartialEq<AddressScore> for AddressScore
source§fn eq(&self, other: &AddressScore) -> bool
fn eq(&self, other: &AddressScore) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<AddressScore> for AddressScore
impl PartialOrd<AddressScore> for AddressScore
source§fn partial_cmp(&self, other: &AddressScore) -> Option<Ordering>
fn partial_cmp(&self, other: &AddressScore) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Sub<u32> for AddressScore
impl Sub<u32> for AddressScore
impl Copy for AddressScore
impl Eq for AddressScore
impl StructuralEq for AddressScore
impl StructuralPartialEq for AddressScore
Auto Trait Implementations§
impl RefUnwindSafe for AddressScore
impl Send for AddressScore
impl Sync for AddressScore
impl Unpin for AddressScore
impl UnwindSafe for AddressScore
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more