Trait stable_mir::Context

source ·
pub trait Context {
Show 19 methods // Required methods fn entry_fn(&mut self) -> Option<CrateItem>; fn all_local_items(&mut self) -> CrateItems; fn mir_body(&mut self, item: DefId) -> Body; fn all_trait_decls(&mut self) -> TraitDecls; fn trait_decl(&mut self, trait_def: &TraitDef) -> TraitDecl; fn all_trait_impls(&mut self) -> ImplTraitDecls; fn trait_impl(&mut self, trait_impl: &ImplDef) -> ImplTrait; fn generics_of(&mut self, def_id: DefId) -> Generics; fn predicates_of(&mut self, def_id: DefId) -> GenericPredicates; fn explicit_predicates_of(&mut self, def_id: DefId) -> GenericPredicates; fn local_crate(&self) -> Crate; fn external_crates(&self) -> Vec<Crate>; fn find_crate(&self, name: &str) -> Option<Crate>; fn name_of_def_id(&self, def_id: DefId) -> String; fn print_span(&self, span: Span) -> String; fn def_kind(&mut self, def_id: DefId) -> DefKind; fn span_of_an_item(&mut self, def_id: DefId) -> Span; fn ty_kind(&mut self, ty: Ty) -> TyKind; fn mk_ty(&mut self, kind: TyKind) -> Ty;
}

Required Methods§

source

fn entry_fn(&mut self) -> Option<CrateItem>

source

fn all_local_items(&mut self) -> CrateItems

Retrieve all items of the local crate that have a MIR associated with them.

source

fn mir_body(&mut self, item: DefId) -> Body

source

fn all_trait_decls(&mut self) -> TraitDecls

source

fn trait_decl(&mut self, trait_def: &TraitDef) -> TraitDecl

source

fn all_trait_impls(&mut self) -> ImplTraitDecls

source

fn trait_impl(&mut self, trait_impl: &ImplDef) -> ImplTrait

source

fn generics_of(&mut self, def_id: DefId) -> Generics

source

fn predicates_of(&mut self, def_id: DefId) -> GenericPredicates

source

fn explicit_predicates_of(&mut self, def_id: DefId) -> GenericPredicates

source

fn local_crate(&self) -> Crate

Get information about the local crate.

source

fn external_crates(&self) -> Vec<Crate>

Retrieve a list of all external crates.

source

fn find_crate(&self, name: &str) -> Option<Crate>

Find a crate with the given name.

source

fn name_of_def_id(&self, def_id: DefId) -> String

Prints the name of given DefId

source

fn print_span(&self, span: Span) -> String

Prints a human readable form of Span

source

fn def_kind(&mut self, def_id: DefId) -> DefKind

Prints the kind of given DefId

source

fn span_of_an_item(&mut self, def_id: DefId) -> Span

Span of an item

source

fn ty_kind(&mut self, ty: Ty) -> TyKind

Obtain the representation of a type.

source

fn mk_ty(&mut self, kind: TyKind) -> Ty

Create a new Ty from scratch without information from rustc.

Implementors§