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§
fn entry_fn(&mut self) -> Option<CrateItem>
sourcefn all_local_items(&mut self) -> CrateItems
fn all_local_items(&mut self) -> CrateItems
Retrieve all items of the local crate that have a MIR associated with them.
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
sourcefn local_crate(&self) -> Crate
fn local_crate(&self) -> Crate
Get information about the local crate.
sourcefn external_crates(&self) -> Vec<Crate>
fn external_crates(&self) -> Vec<Crate>
Retrieve a list of all external crates.
sourcefn find_crate(&self, name: &str) -> Option<Crate>
fn find_crate(&self, name: &str) -> Option<Crate>
Find a crate with the given name.
sourcefn name_of_def_id(&self, def_id: DefId) -> String
fn name_of_def_id(&self, def_id: DefId) -> String
Prints the name of given DefId
sourcefn print_span(&self, span: Span) -> String
fn print_span(&self, span: Span) -> String
Prints a human readable form of Span
sourcefn span_of_an_item(&mut self, def_id: DefId) -> Span
fn span_of_an_item(&mut self, def_id: DefId) -> Span
Span
of an item