pub struct CandidateStep<'db> {
pub self_ty: Canonical<'db, QueryResponse<'db, Ty<'db>>>,
pub self_ty_is_opaque: bool,
pub autoderefs: usize,
pub from_unsafe_deref: bool,
pub unsize: bool,
pub reachable_via_deref: bool,
}Fields§
§self_ty: Canonical<'db, QueryResponse<'db, Ty<'db>>>§self_ty_is_opaque: bool§autoderefs: usize§from_unsafe_deref: booltrue if the type results from a dereference of a raw pointer.
when assembling candidates, we include these steps, but not when
picking methods. This so that if we have foo: *const Foo and Foo has methods
fn by_raw_ptr(self: *const Self) and fn by_ref(&self), then
foo.by_raw_ptr() will work and foo.by_ref() won’t.
unsize: bool§reachable_via_deref: boolWe will generate CandidateSteps which are reachable via a chain
of following Receiver. The first ‘n’ of those will be reachable
by following a chain of ‘Deref’ instead (since there’s a blanket
implementation of Receiver for Deref).
We use the entire set of steps when identifying method candidates
(e.g. identifying relevant impl blocks) but only those that are
reachable via Deref when examining what the receiver type can
be converted into by autodereffing.
Trait Implementations§
Source§impl<'db> Clone for CandidateStep<'db>
impl<'db> Clone for CandidateStep<'db>
Source§fn clone(&self) -> CandidateStep<'db>
fn clone(&self) -> CandidateStep<'db>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<'db> Freeze for CandidateStep<'db>
impl<'db> RefUnwindSafe for CandidateStep<'db>
impl<'db> Send for CandidateStep<'db>
impl<'db> Sync for CandidateStep<'db>
impl<'db> Unpin for CandidateStep<'db>
impl<'db> UnwindSafe for CandidateStep<'db>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
§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> ⓘ
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