Enum tor_netdoc::doc::netstatus::RelayWeight
source · #[non_exhaustive]pub enum RelayWeight {
Unmeasured(u32),
Measured(u32),
}
Expand description
Recognized weight fields on a single relay in a consensus
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Implementations§
source§impl RelayWeight
impl RelayWeight
sourcepub fn is_measured(&self) -> bool
pub fn is_measured(&self) -> bool
Return true if this weight is the result of a successful measurement
sourcepub fn is_nonzero(&self) -> bool
pub fn is_nonzero(&self) -> bool
Return true if this weight is nonzero
Trait Implementations§
source§impl Clone for RelayWeight
impl Clone for RelayWeight
source§fn clone(&self) -> RelayWeight
fn clone(&self) -> RelayWeight
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 RelayWeight
impl Debug for RelayWeight
source§impl Default for RelayWeight
impl Default for RelayWeight
source§fn default() -> RelayWeight
fn default() -> RelayWeight
Returns the “default value” for a type. Read more
impl Copy for RelayWeight
Auto Trait Implementations§
impl Freeze for RelayWeight
impl RefUnwindSafe for RelayWeight
impl Send for RelayWeight
impl Sync for RelayWeight
impl Unpin for RelayWeight
impl UnwindSafe for RelayWeight
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more