Struct tor_relay_selection::SelectionInfo
source · pub struct SelectionInfo<'a> { /* private fields */ }Expand description
Information about how a given selection was generated.
Records the specifics of how many relays were excluded by each requirement, whether we had to relax the selector, and so on.
The caller should typically decide whether an error or warning is necessary, and if so use this to generate a formattable report about what went wrong.
Implementations§
source§impl<'a> SelectionInfo<'a>
impl<'a> SelectionInfo<'a>
sourcepub fn success(&self) -> bool
pub fn success(&self) -> bool
Return true if we eventually picked at least one relay.
(We report success on pick_n_relays if we returned a nonzero
number of relays, even if it is smaller than the requested number.)
sourcepub fn result_is_relaxed_success(&self) -> bool
pub fn result_is_relaxed_success(&self) -> bool
Return true if picked at least one relay, but only after relaxing our initial selector.
Trait Implementations§
source§impl<'a> Clone for SelectionInfo<'a>
impl<'a> Clone for SelectionInfo<'a>
source§fn clone(&self) -> SelectionInfo<'a>
fn clone(&self) -> SelectionInfo<'a>
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<'a> Debug for SelectionInfo<'a>
impl<'a> Debug for SelectionInfo<'a>
Auto Trait Implementations§
impl<'a> Freeze for SelectionInfo<'a>
impl<'a> RefUnwindSafe for SelectionInfo<'a>
impl<'a> Send for SelectionInfo<'a>
impl<'a> Sync for SelectionInfo<'a>
impl<'a> Unpin for SelectionInfo<'a>
impl<'a> UnwindSafe for SelectionInfo<'a>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§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