pub struct Project<'a> {
pub pool: IndexMap<DefID, Def<'a>>,
pub anon_types: HashMap<TypeKind, DefID>,
pub root: DefID,
}
Fields§
§pool: IndexMap<DefID, Def<'a>>
§anon_types: HashMap<TypeKind, DefID>
Stores anonymous tuples, function pointer types, etc.
root: DefID
Implementations§
source§impl<'a> Project<'a>
impl<'a> Project<'a>
pub fn parent_of(&self, module: DefID) -> Option<DefID>
pub fn root_of(&self, module: DefID) -> DefID
pub fn get<'p>( &self, path: Path<'p>, within: DefID ) -> Option<(Option<DefID>, Option<DefID>, Path<'p>)>
sourcepub fn get_type<'p>(
&self,
path: Path<'p>,
within: DefID
) -> Option<(DefID, Path<'p>)>
pub fn get_type<'p>( &self, path: Path<'p>, within: DefID ) -> Option<(DefID, Path<'p>)>
Resolves a path within a module tree, finding the innermost module. Returns the remaining path parts.
pub fn get_value<'p>( &self, path: Path<'p>, within: DefID ) -> Option<(DefID, Path<'p>)>
sourcepub fn insert_anonymous_type(
&mut self,
kind: TypeKind,
def: impl FnOnce() -> Def<'a>
) -> DefID
pub fn insert_anonymous_type( &mut self, kind: TypeKind, def: impl FnOnce() -> Def<'a> ) -> DefID
Inserts the type returned by the provided closure iff the TypeKind doesn’t already exist
Assumes kind
uniquely identifies the type!
pub fn evaluate<T>(&mut self, expr: &T, parent: DefID) -> Result<T::Out, String>where
T: EvaluableTypeExpression,
source§impl<'a> Project<'a>
impl<'a> Project<'a>
pub fn resolve_imports(&mut self) -> Result<(), String>
pub fn visit_def(&mut self, id: DefID) -> Result<(), String>
pub fn visit_use(&mut self, u: &'a Use, parent: DefID) -> Result<(), String>
pub fn visit_use_tree( &mut self, tree: &'a UseTree, parent: DefID, c: DefID ) -> Result<(), String>
pub fn visit_use_path(&mut self) -> Result<(), String>
pub fn visit_use_leaf( &mut self, name: &'a Sym, parent: DefID, c: DefID ) -> Result<(), String>
pub fn visit_use_alias( &mut self, from: &Sym, name: &Sym, parent: DefID, c: DefID ) -> Result<(), String>
pub fn visit_use_glob(&mut self, parent: DefID, c: DefID) -> Result<(), String>
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Project<'a>
impl<'a> RefUnwindSafe for Project<'a>
impl<'a> Send for Project<'a>
impl<'a> Sync for Project<'a>
impl<'a> Unpin for Project<'a>
impl<'a> UnwindSafe for Project<'a>
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