[][src]Trait rustc::ty::print::Printer

pub trait Printer<'tcx>: Sized {
    type Error;
    type Path;
    type Region;
    type Type;
    type DynExistential;
    type Const;
    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<ExistentialPredicate<'tcx>>
    ) -> Result<Self::DynExistential, Self::Error>;
fn print_const(
        self,
        ct: &'tcx 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> { ... } }
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

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.

Associated Types

type Error

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

type Path

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

type Region

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

type Type

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

type DynExistential

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

type Const

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Loading content...

Required methods

fn tcx<'a>(&'a self) -> TyCtxt<'tcx>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn print_region(self, region: Region) -> Result<Self::Region, Self::Error>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn print_type(self, ty: Ty<'tcx>) -> Result<Self::Type, Self::Error>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn print_dyn_existential(
    self,
    predicates: &'tcx List<ExistentialPredicate<'tcx>>
) -> Result<Self::DynExistential, Self::Error>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn print_const(self, ct: &'tcx Const<'tcx>) -> Result<Self::Const, Self::Error>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn path_crate(self, cnum: CrateNum) -> Result<Self::Path, Self::Error>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn path_qualified(
    self,
    self_ty: Ty<'tcx>,
    trait_ref: Option<TraitRef<'tcx>>
) -> Result<Self::Path, Self::Error>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

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>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn path_append(
    self,
    print_prefix: impl FnOnce(Self) -> Result<Self::Path, Self::Error>,
    disambiguated_data: &DisambiguatedDefPathData
) -> Result<Self::Path, Self::Error>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn path_generic_args(
    self,
    print_prefix: impl FnOnce(Self) -> Result<Self::Path, Self::Error>,
    args: &[GenericArg<'tcx>]
) -> Result<Self::Path, Self::Error>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Loading content...

Provided methods

fn print_def_path(
    self,
    def_id: DefId,
    substs: &'tcx [GenericArg<'tcx>]
) -> Result<Self::Path, Self::Error>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

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>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn default_print_def_path(
    self,
    def_id: DefId,
    substs: &'tcx [GenericArg<'tcx>]
) -> Result<Self::Path, Self::Error>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn generic_args_to_print(
    &self,
    generics: &'tcx Generics,
    substs: &'tcx [GenericArg<'tcx>]
) -> &'tcx [GenericArg<'tcx>]

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

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>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Loading content...

Implementors

impl<'tcx, '_, F: Write> Printer<'tcx> for FmtPrinter<'_, 'tcx, F>[src]

type Error = Error

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

type Path = Self

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

type Region = Self

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

type Type = Self

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

type DynExistential = Self

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

type Const = Self

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Loading content...