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§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
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 more