pub struct NoEnv;Expand description
An environment with nothing in it: every name outside the program is unresolved.
§Examples
use hir_lang::{Name, Symbol};
use resolve_lang::{Env, NoEnv};
let n = Name::new(Symbol::from_u32(1).unwrap());
assert!(NoEnv.root(n).is_none());Trait Implementations§
impl Copy for NoEnv
Source§impl Env for NoEnv
impl Env for NoEnv
Source§fn root(&self, name: Name) -> Option<Export>
fn root(&self, name: Name) -> Option<Export>
A name visible as the first segment of a path in every unit, after
every lexical scope: another package, a precompiled unit, an extern
module. Usually a
DefKind::Module or DefKind::Extern.Source§fn prelude(&self, name: Name, ns: Namespace) -> Option<Export>
fn prelude(&self, name: Name, ns: Namespace) -> Option<Export>
The prelude: names visible everywhere, after lexical scopes and roots
(builtins, primitive type names).
Source§fn member(&self, container: Res, name: Name, ns: Namespace) -> Option<Export>
fn member(&self, container: Res, name: Name, ns: Namespace) -> Option<Export>
A member of a container the program does not define: a module or class
of another package, an extern module.
container is the resolution
the path reached so far.Source§fn for_each_member(
&self,
container: Res,
f: &mut dyn FnMut(Name, Namespace, Export),
)
fn for_each_member( &self, container: Res, f: &mut dyn FnMut(Name, Namespace, Export), )
Calls
f for every member of an outside container, for glob imports
and suggestions.Source§fn for_each_root(&self, f: &mut dyn FnMut(Name))
fn for_each_root(&self, f: &mut dyn FnMut(Name))
Calls
f for every root name, for suggestions.impl Eq for NoEnv
impl StructuralPartialEq for NoEnv
Auto Trait Implementations§
impl Freeze for NoEnv
impl RefUnwindSafe for NoEnv
impl Send for NoEnv
impl Sync for NoEnv
impl Unpin for NoEnv
impl UnsafeUnpin for NoEnv
impl UnwindSafe for NoEnv
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