pub struct Selection<'a, T> { /* private fields */ }Expand description
Borrowed, filtered dependency results. Filters combine by intersection.
Implementations§
Source§impl<'a, T: Dependency> Selection<'a, T>
impl<'a, T: Dependency> Selection<'a, T>
Sourcepub fn one(&self) -> Result<&'a T, DependencyError>
pub fn one(&self) -> Result<&'a T, DependencyError>
Returns exactly one result, reporting missing or ambiguous matches.
Sourcepub fn optional(&self) -> Result<Option<&'a T>, DependencyError>
pub fn optional(&self) -> Result<Option<&'a T>, DependencyError>
Returns zero or one result; several matches produce an ambiguity error.
Sourcepub fn iter(&self) -> impl ExactSizeIterator<Item = &'a T> + '_
pub fn iter(&self) -> impl ExactSizeIterator<Item = &'a T> + '_
Iterates all matching results in snapshot order, including zero matches.
Source§impl Selection<'_, RecordingDependency>
impl Selection<'_, RecordingDependency>
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Forget for Selection<'a, T>
impl<'a, T> Freeze for Selection<'a, T>
impl<'a, T> Move for Selection<'a, T>
impl<'a, T> RefUnwindSafe for Selection<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for Selection<'a, T>
impl<'a, T> Sync for Selection<'a, T>
impl<'a, T> Unpin for Selection<'a, T>
impl<'a, T> UnsafeUnpin for Selection<'a, T>where
*const u8 is !null: UnsafeUnpin,
PhantomData<&'a T>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
impl<'a, T> UnwindSafe for Selection<'a, T>
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§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