pub struct Scope<'src> {
pub namespace: Option<Cow<'src, str>>,
pub class_name: Option<&'src str>,
pub function_name: Option<&'src str>,
}Expand description
Lexical scope context passed to each ScopeVisitor method.
Represents the immediately enclosing namespace, class-like definition,
and named function or method at the point a node is visited.
All fields are None when the node is at the global top level.
Namespace is set when inside a braced or simple namespace declaration.
class_name is set inside class, interface, trait, and enum
declarations; it is None for anonymous classes.
function_name is set inside named functions and methods; it is None
inside closures and arrow functions.
Fields§
§namespace: Option<Cow<'src, str>>Current namespace, or None for the global namespace.
class_name: Option<&'src str>Name of the immediately enclosing class-like declaration, or None.
function_name: Option<&'src str>Name of the immediately enclosing named function or method, or None.
Trait Implementations§
Auto Trait Implementations§
impl<'src> Freeze for Scope<'src>
impl<'src> RefUnwindSafe for Scope<'src>
impl<'src> Send for Scope<'src>
impl<'src> Sync for Scope<'src>
impl<'src> Unpin for Scope<'src>
impl<'src> UnsafeUnpin for Scope<'src>
impl<'src> UnwindSafe for Scope<'src>
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