pub trait Printer<'tcx>: Sized {
    type Error;
    type Path;
    type Region;
    type Type;
    type DynExistential;
    type Const;

Show 15 methods fn tcx<'a>(&'a self) -> TyCtxt<'tcx>; fn print_region(
        self,
        region: Region<'_>
    ) -> Result<Self::Region, Self::Error>; fn print_type(self, ty: Ty<'tcx>) -> Result<Self::Type, Self::Error>; fn print_dyn_existential(
        self,
        predicates: &'tcx List<Binder<'tcx, ExistentialPredicate<'tcx>>>
    ) -> Result<Self::DynExistential, Self::Error>; fn print_const(self, ct: Const<'tcx>) -> Result<Self::Const, Self::Error>; fn path_crate(self, cnum: CrateNum) -> Result<Self::Path, Self::Error>; fn path_qualified(
        self,
        self_ty: Ty<'tcx>,
        trait_ref: Option<TraitRef<'tcx>>
    ) -> Result<Self::Path, Self::Error>; fn path_append_impl(
        self,
        print_prefix: impl FnOnce(Self) -> Result<Self::Path, Self::Error>,
        disambiguated_data: &DisambiguatedDefPathData,
        self_ty: Ty<'tcx>,
        trait_ref: Option<TraitRef<'tcx>>
    ) -> Result<Self::Path, Self::Error>; fn path_append(
        self,
        print_prefix: impl FnOnce(Self) -> Result<Self::Path, Self::Error>,
        disambiguated_data: &DisambiguatedDefPathData
    ) -> Result<Self::Path, Self::Error>; fn path_generic_args(
        self,
        print_prefix: impl FnOnce(Self) -> Result<Self::Path, Self::Error>,
        args: &[GenericArg<'tcx>]
    ) -> Result<Self::Path, Self::Error>; fn print_def_path(
        self,
        def_id: DefId,
        substs: &'tcx [GenericArg<'tcx>]
    ) -> Result<Self::Path, Self::Error> { ... } fn print_impl_path(
        self,
        impl_def_id: DefId,
        substs: &'tcx [GenericArg<'tcx>],
        self_ty: Ty<'tcx>,
        trait_ref: Option<TraitRef<'tcx>>
    ) -> Result<Self::Path, Self::Error> { ... } fn default_print_def_path(
        self,
        def_id: DefId,
        substs: &'tcx [GenericArg<'tcx>]
    ) -> Result<Self::Path, Self::Error> { ... } fn generic_args_to_print(
        &self,
        generics: &'tcx Generics,
        substs: &'tcx [GenericArg<'tcx>]
    ) -> &'tcx [GenericArg<'tcx>] { ... } fn default_print_impl_path(
        self,
        impl_def_id: DefId,
        _substs: &'tcx [GenericArg<'tcx>],
        self_ty: Ty<'tcx>,
        impl_trait_ref: Option<TraitRef<'tcx>>
    ) -> Result<Self::Path, Self::Error> { ... }
}
Expand description

Interface for outputting user-facing “type-system entities” (paths, types, lifetimes, constants, etc.) as a side-effect (e.g. formatting, like PrettyPrinter implementors do) or by constructing some alternative representation (e.g. an AST), which the associated types allow passing through the methods.

For pretty-printing/formatting in particular, see PrettyPrinter.

Required Associated Types

Required Methods

Provided Methods

Implementors