pub struct GenericTypeCandidates<'tcx> {
trait_map: HashMap<String, HashSet<Ty<'tcx>>>,
}Expand description
Representative concrete types satisfying generic trait bounds.
Fields§
§trait_map: HashMap<String, HashSet<Ty<'tcx>>>Implementations§
Source§impl<'tcx> GenericTypeCandidates<'tcx>
impl<'tcx> GenericTypeCandidates<'tcx>
Sourcepub fn for_def(tcx: TyCtxt<'tcx>, def_id: DefId) -> Self
pub fn for_def(tcx: TyCtxt<'tcx>, def_id: DefId) -> Self
Build generic type candidates from a function definition.
Sourcepub fn new(tcx: TyCtxt<'tcx>, param_env: ParamEnv<'tcx>) -> Self
pub fn new(tcx: TyCtxt<'tcx>, param_env: ParamEnv<'tcx>) -> Self
Build generic type candidates from a parameter environment.
Sourcepub fn candidates_for(&self, generic_name: &str) -> Option<&HashSet<Ty<'tcx>>>
pub fn candidates_for(&self, generic_name: &str) -> Option<&HashSet<Ty<'tcx>>>
Return the representative types for a generic parameter name.
Sourcepub fn candidates_for_ty(&self, ty: Ty<'tcx>) -> Option<&HashSet<Ty<'tcx>>>
pub fn candidates_for_ty(&self, ty: Ty<'tcx>) -> Option<&HashSet<Ty<'tcx>>>
Return representative types for a generic parameter type.
fn pod_types(tcx: TyCtxt<'tcx>) -> HashSet<Ty<'tcx>>
Auto Trait Implementations§
impl<'tcx> Freeze for GenericTypeCandidates<'tcx>
impl<'tcx> !RefUnwindSafe for GenericTypeCandidates<'tcx>
impl<'tcx> Send for GenericTypeCandidates<'tcx>
impl<'tcx> Sync for GenericTypeCandidates<'tcx>
impl<'tcx> Unpin for GenericTypeCandidates<'tcx>
impl<'tcx> !UnwindSafe for GenericTypeCandidates<'tcx>
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> 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