pub(crate) struct RouterStatusIdx(pub(crate) usize);
Expand description
Index into the consensus relays
This is an index into the list of relays returned by
.c_relays()
(on the corresponding consensus or netdir).
This is just a usize
inside, but using a newtype prevents getting a relay index
confused with other kinds of slice indices or counts.
If you are in a part of the code which needs to work with multiple consensuses, the typechecking cannot tell if you try to index into the wrong consensus.
Tuple Fields§
§0: usize
Trait Implementations§
Source§impl Clone for RouterStatusIdx
impl Clone for RouterStatusIdx
Source§fn clone(&self) -> RouterStatusIdx
fn clone(&self) -> RouterStatusIdx
Returns a duplicate 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 RouterStatusIdx
impl Debug for RouterStatusIdx
Source§impl From<RouterStatusIdx> for usize
impl From<RouterStatusIdx> for usize
Source§fn from(value: RouterStatusIdx) -> Self
fn from(value: RouterStatusIdx) -> Self
Converts to this type from the input type.
Source§impl From<usize> for RouterStatusIdx
impl From<usize> for RouterStatusIdx
Source§impl Hash for RouterStatusIdx
impl Hash for RouterStatusIdx
Source§impl Ord for RouterStatusIdx
impl Ord for RouterStatusIdx
Source§fn cmp(&self, other: &RouterStatusIdx) -> Ordering
fn cmp(&self, other: &RouterStatusIdx) -> 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 for RouterStatusIdx
impl PartialEq for RouterStatusIdx
Source§impl PartialOrd for RouterStatusIdx
impl PartialOrd for RouterStatusIdx
impl Copy for RouterStatusIdx
impl Eq for RouterStatusIdx
impl StructuralPartialEq for RouterStatusIdx
Auto Trait Implementations§
impl Freeze for RouterStatusIdx
impl RefUnwindSafe for RouterStatusIdx
impl Send for RouterStatusIdx
impl Sync for RouterStatusIdx
impl Unpin for RouterStatusIdx
impl UnwindSafe for RouterStatusIdx
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§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§impl<K, V> TiSliceIndex<K, V> for K
impl<K, V> TiSliceIndex<K, V> for K
§fn get(
self,
slice: &TiSlice<K, V>,
) -> Option<&<K as TiSliceIndex<K, V>>::Output>
fn get( self, slice: &TiSlice<K, V>, ) -> Option<&<K as TiSliceIndex<K, V>>::Output>
Returns a shared reference to the output at this location, if in
bounds.
§fn get_mut(
self,
slice: &mut TiSlice<K, V>,
) -> Option<&mut <K as TiSliceIndex<K, V>>::Output>
fn get_mut( self, slice: &mut TiSlice<K, V>, ) -> Option<&mut <K as TiSliceIndex<K, V>>::Output>
Returns a mutable reference to the output at this location, if in
bounds.
§unsafe fn get_unchecked(
self,
slice: &TiSlice<K, V>,
) -> &<K as TiSliceIndex<K, V>>::Output
unsafe fn get_unchecked( self, slice: &TiSlice<K, V>, ) -> &<K as TiSliceIndex<K, V>>::Output
Returns a shared reference to the output at this location, without
performing any bounds checking.
Calling this method with an out-of-bounds index is undefined behavior
even if the resulting reference is not used.
§unsafe fn get_unchecked_mut(
self,
slice: &mut TiSlice<K, V>,
) -> &mut <K as TiSliceIndex<K, V>>::Output
unsafe fn get_unchecked_mut( self, slice: &mut TiSlice<K, V>, ) -> &mut <K as TiSliceIndex<K, V>>::Output
Returns a mutable reference to the output at this location, without
performing any bounds checking.
Calling this method with an out-of-bounds index is undefined behavior
even if the resulting reference is not used.