pub struct VisitorContext {
pub module_name: ModuleName,
pub file_path: String,
pub current_class: Option<String>,
pub nested_level: usize,
}Expand description
Common functionality for AST visitors
Fields§
§module_name: ModuleName§file_path: String§current_class: Option<String>§nested_level: usizeImplementations§
Source§impl VisitorContext
impl VisitorContext
pub fn new(module_name: ModuleName, file_path: String) -> Self
Sourcepub fn enter_class(&mut self, class_name: &str)
pub fn enter_class(&mut self, class_name: &str)
Enter a class scope
Sourcepub fn exit_class(&mut self)
pub fn exit_class(&mut self)
Exit a class scope
Sourcepub fn current_context(&self) -> String
pub fn current_context(&self) -> String
Get the current qualified context
Sourcepub fn qualify_function(&self, function_name: &FunctionName) -> QualifiedName
pub fn qualify_function(&self, function_name: &FunctionName) -> QualifiedName
Create a qualified name for a function
Auto Trait Implementations§
impl Freeze for VisitorContext
impl RefUnwindSafe for VisitorContext
impl Send for VisitorContext
impl Sync for VisitorContext
impl Unpin for VisitorContext
impl UnsafeUnpin for VisitorContext
impl UnwindSafe for VisitorContext
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more