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
sourceimpl Add<AddressScore> for AddressScore
impl Add<AddressScore> for AddressScore
type Output = AddressScore
type Output = AddressScore
The resulting type after applying the +
operator.
sourcepub fn add(
self,
rhs: AddressScore
) -> <AddressScore as Add<AddressScore>>::Output
pub fn add(
self,
rhs: AddressScore
) -> <AddressScore as Add<AddressScore>>::Output
Performs the +
operation. Read more
sourceimpl Clone for AddressScore
impl Clone for AddressScore
sourcepub fn clone(&self) -> AddressScore
pub fn clone(&self) -> AddressScore
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for AddressScore
impl Debug for AddressScore
sourceimpl Hash for AddressScore
impl Hash for AddressScore
sourceimpl Ord for AddressScore
impl Ord for AddressScore
sourceimpl PartialEq<AddressScore> for AddressScore
impl PartialEq<AddressScore> for AddressScore
sourcepub fn eq(&self, other: &AddressScore) -> bool
pub fn eq(&self, other: &AddressScore) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcepub fn ne(&self, other: &AddressScore) -> bool
pub fn ne(&self, other: &AddressScore) -> bool
This method tests for !=
.
sourceimpl PartialOrd<AddressScore> for AddressScore
impl PartialOrd<AddressScore> for AddressScore
sourcepub fn partial_cmp(&self, other: &AddressScore) -> Option<Ordering>
pub fn partial_cmp(&self, other: &AddressScore) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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
sourceimpl Sub<u32> for AddressScore
impl Sub<u32> for AddressScore
type Output = AddressScore
type Output = AddressScore
The resulting type after applying the -
operator.
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CallHasher for T where
T: Hash + ?Sized,
impl<T> CallHasher for T where
T: Hash + ?Sized,
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more