pub struct SelectionInfo<'a> {
first_try: FilterCounts,
relaxed_try: Option<FilterCounts>,
succeeded: bool,
in_selection: &'a RelaySelector<'a>,
}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.
Fields§
§first_try: FilterCountsOutcome of our first attempt to pick a relay.
relaxed_try: Option<FilterCounts>Present if we tried again with a relaxed version of our flexible members.
succeeded: boolTrue if we eventually succeeded in picking a relay.
in_selection: &'a RelaySelector<'a>The RelaySelector that was used.
Used to produce information about which restriction is which.
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>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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> UnsafeUnpin for SelectionInfo<'a>
impl<'a> UnwindSafe for SelectionInfo<'a>
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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>
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>
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