pub struct PathResolver<'tcx> {
tcx: TyCtxt<'tcx>,
path_map: HashMap<DefId, String>,
}Expand description
A utility to resolve the actual visible path for re-export items.
Fields§
§tcx: TyCtxt<'tcx>§path_map: HashMap<DefId, String>Implementations§
Source§impl<'tcx> PathResolver<'tcx>
impl<'tcx> PathResolver<'tcx>
fn new(tcx: TyCtxt<'tcx>) -> Self
fn build(&mut self, mod_id: DefId, current_path: String)
fn non_assoc_path_str(&self, def_id: DefId) -> String
pub fn ty_str(&self, ty: Ty<'tcx>) -> String
pub fn path_str(&self, def_id: DefId) -> String
pub fn path_str_with_args( &self, def_id: DefId, args: GenericArgsRef<'tcx>, ) -> String
pub fn generic_arg_str(&self, arg: GenericArg<'tcx>) -> String
fn generic_args_str(&self, generic_args: &[GenericArg<'tcx>]) -> String
Auto Trait Implementations§
impl<'tcx> Freeze for PathResolver<'tcx>
impl<'tcx> !RefUnwindSafe for PathResolver<'tcx>
impl<'tcx> !Send for PathResolver<'tcx>
impl<'tcx> !Sync for PathResolver<'tcx>
impl<'tcx> Unpin for PathResolver<'tcx>
impl<'tcx> !UnwindSafe for PathResolver<'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