pub struct NameFinder<'a> {
pub names: FxHashMap<&'a str, &'a ExprName>,
}Expand description
A Visitor to collect all Expr::Name nodes in an AST.
Fields§
§names: FxHashMap<&'a str, &'a ExprName>A map from identifier to defining expression.
Trait Implementations§
Source§impl<'a> Debug for NameFinder<'a>
impl<'a> Debug for NameFinder<'a>
Source§impl<'a> Default for NameFinder<'a>
impl<'a> Default for NameFinder<'a>
Source§fn default() -> NameFinder<'a>
fn default() -> NameFinder<'a>
Returns the “default value” for a type. Read more
Source§impl<'a> Visitor<'a> for NameFinder<'a>
impl<'a> Visitor<'a> for NameFinder<'a>
fn visit_expr(&mut self, expr: &'a Expr)
fn visit_stmt(&mut self, stmt: &'a Stmt)
fn visit_annotation(&mut self, expr: &'a Expr)
fn visit_decorator(&mut self, decorator: &'a Decorator)
fn visit_expr_context(&mut self, expr_context: &'a ExprContext)
fn visit_bool_op(&mut self, bool_op: &'a BoolOp)
fn visit_operator(&mut self, operator: &'a Operator)
fn visit_unary_op(&mut self, unary_op: &'a UnaryOp)
fn visit_cmp_op(&mut self, cmp_op: &'a CmpOp)
fn visit_comprehension(&mut self, comprehension: &'a Comprehension)
fn visit_except_handler(&mut self, except_handler: &'a ExceptHandler)
fn visit_arguments(&mut self, arguments: &'a Arguments)
fn visit_parameters(&mut self, parameters: &'a Parameters)
fn visit_parameter(&mut self, parameter: &'a Parameter)
fn visit_keyword(&mut self, keyword: &'a Keyword)
fn visit_alias(&mut self, alias: &'a Alias)
fn visit_with_item(&mut self, with_item: &'a WithItem)
fn visit_type_params(&mut self, type_params: &'a TypeParams)
fn visit_type_param(&mut self, type_param: &'a TypeParam)
fn visit_match_case(&mut self, match_case: &'a MatchCase)
fn visit_pattern(&mut self, pattern: &'a Pattern)
fn visit_pattern_arguments(&mut self, pattern_arguments: &'a PatternArguments)
fn visit_pattern_keyword(&mut self, pattern_keyword: &'a PatternKeyword)
fn visit_body(&mut self, body: &'a [Stmt])
fn visit_elif_else_clause(&mut self, elif_else_clause: &'a ElifElseClause)
fn visit_f_string(&mut self, f_string: &'a FString)
fn visit_interpolated_string_element( &mut self, interpolated_string_element: &'a InterpolatedStringElement, )
fn visit_t_string(&mut self, t_string: &'a TString)
fn visit_string_literal(&mut self, string_literal: &'a StringLiteral)
fn visit_bytes_literal(&mut self, bytes_literal: &'a BytesLiteral)
Auto Trait Implementations§
impl<'a> Freeze for NameFinder<'a>
impl<'a> RefUnwindSafe for NameFinder<'a>
impl<'a> Send for NameFinder<'a>
impl<'a> Sync for NameFinder<'a>
impl<'a> Unpin for NameFinder<'a>
impl<'a> UnsafeUnpin for NameFinder<'a>
impl<'a> UnwindSafe for NameFinder<'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
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