pub struct ImplLookupContext<'db> {
pub crate_id: CrateId<'db>,
pub generic_params: Vec<GenericParamId<'db>>,
pub inner_impls: BTreeSet<UninferredImplById<'db>>,
pub negative_impls: Vec<GenericParamId<'db>>,
}Fields§
§crate_id: CrateId<'db>§generic_params: Vec<GenericParamId<'db>>§inner_impls: BTreeSet<UninferredImplById<'db>>§negative_impls: Vec<GenericParamId<'db>>Implementations§
Source§impl<'db> ImplLookupContext<'db>
impl<'db> ImplLookupContext<'db>
Sourcepub fn new_from_crate(crate_id: CrateId<'db>) -> Self
pub fn new_from_crate(crate_id: CrateId<'db>) -> Self
Creates a new ImplLookupContext from a CrateId.
Sourcepub fn new_from_type(ty: TypeId<'db>, db: &'db dyn Database) -> Self
pub fn new_from_type(ty: TypeId<'db>, db: &'db dyn Database) -> Self
Creates a new ImplLookupContext from a TypeId with the crate being the crate of the type’s module.
Sourcepub fn new(
module_id: ModuleId<'db>,
generic_params: Vec<GenericParamId<'db>>,
db: &'db dyn Database,
) -> ImplLookupContext<'db>
pub fn new( module_id: ModuleId<'db>, generic_params: Vec<GenericParamId<'db>>, db: &'db dyn Database, ) -> ImplLookupContext<'db>
Creates a new ImplLookupContext from a ModuleId.
pub fn insert_lookup_scope( &mut self, db: &'db dyn Database, imp: &UninferredImpl<'db>, )
Sourcepub fn insert_module(&mut self, module_id: ModuleId<'db>, db: &'db dyn Database)
pub fn insert_module(&mut self, module_id: ModuleId<'db>, db: &'db dyn Database)
Inserts a module into the lookup context, extending the inner impls with the module’s impls.
Sourcepub fn insert_impl(&mut self, impl_id: ImplId<'db>, db: &'db dyn Database)
pub fn insert_impl(&mut self, impl_id: ImplId<'db>, db: &'db dyn Database)
Inserts an impl into the lookup context, extending the inner impls with the impl’s trait impls.
Sourcepub fn strip_for_trait_id(&mut self, db: &dyn Database, trait_id: TraitId<'db>)
pub fn strip_for_trait_id(&mut self, db: &dyn Database, trait_id: TraitId<'db>)
Strips the lookup context of all impls that are not reachable in the dependency graph from the given trait.
Trait Implementations§
Source§impl<'db> Clone for ImplLookupContext<'db>
impl<'db> Clone for ImplLookupContext<'db>
Source§fn clone(&self) -> ImplLookupContext<'db>
fn clone(&self) -> ImplLookupContext<'db>
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<'db> Debug for ImplLookupContext<'db>
impl<'db> Debug for ImplLookupContext<'db>
Source§impl<'db> DebugWithDb<'db> for ImplLookupContext<'db>
impl<'db> DebugWithDb<'db> for ImplLookupContext<'db>
type Db = dyn Database
fn fmt(&self, f: &mut Formatter<'_>, db: &'db dyn Database) -> Result
fn debug<'me>(&'me self, db: &'db Self::Db) -> DebugWith<'me, 'db, Self::Db>where
Self: Sized + 'me,
fn into_debug<'me>(self, db: &'db Self::Db) -> DebugWith<'me, 'db, Self::Db>where
Self: Sized + 'me,
Source§impl<'db> Hash for ImplLookupContext<'db>
impl<'db> Hash for ImplLookupContext<'db>
Source§impl<'db> Intern<'db, ImplLookupContextId<'db>> for ImplLookupContext<'db>
impl<'db> Intern<'db, ImplLookupContextId<'db>> for ImplLookupContext<'db>
fn intern(self, db: &'db dyn Database) -> ImplLookupContextId<'db>
Source§impl<'db> PartialEq for ImplLookupContext<'db>
impl<'db> PartialEq for ImplLookupContext<'db>
impl<'db> Eq for ImplLookupContext<'db>
impl<'db> StructuralPartialEq for ImplLookupContext<'db>
Auto Trait Implementations§
impl<'db> Freeze for ImplLookupContext<'db>
impl<'db> RefUnwindSafe for ImplLookupContext<'db>
impl<'db> Send for ImplLookupContext<'db>
impl<'db> Sync for ImplLookupContext<'db>
impl<'db> Unpin for ImplLookupContext<'db>
impl<'db> UnwindSafe for ImplLookupContext<'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
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<'db, T> DebugDbUpcast<'db, T> for Twhere
T: ?Sized,
impl<'db, T> DebugDbUpcast<'db, T> for Twhere
T: ?Sized,
fn debug_db_upcast(&'db self) -> &'db T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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