Skip to main content

OwnedScopeWalker

Struct OwnedScopeWalker 

Source
pub struct OwnedScopeWalker<V> { /* private fields */ }
Expand description

Drives an OwnedScopeVisitor over an owned AST, maintaining OwnedScope automatically.

Implementations§

Source§

impl<V> OwnedScopeWalker<V>

Source

pub fn new(inner: V) -> Self

Creates a new walker wrapping inner.

Source

pub fn into_inner(self) -> V

Consumes the walker and returns the inner visitor.

Source

pub fn inner(&self) -> &V

Returns a reference to the inner visitor.

Source

pub fn inner_mut(&mut self) -> &mut V

Returns a mutable reference to the inner visitor.

Source§

impl<V: OwnedScopeVisitor> OwnedScopeWalker<V>

Source

pub fn walk(&mut self, program: &Program) -> ControlFlow<()>

Walks program, calling OwnedScopeVisitor methods with scope context.

Trait Implementations§

Source§

impl<V: OwnedScopeVisitor> OwnedVisitor for OwnedScopeWalker<V>

Source§

fn visit_program(&mut self, program: &Program) -> ControlFlow<()>

Source§

fn visit_stmt(&mut self, stmt: &Stmt) -> ControlFlow<()>

Source§

fn visit_expr(&mut self, expr: &Expr) -> ControlFlow<()>

Source§

fn visit_class_member(&mut self, member: &ClassMember) -> ControlFlow<()>

Source§

fn visit_enum_member(&mut self, member: &EnumMember) -> ControlFlow<()>

Source§

fn visit_param(&mut self, param: &Param) -> ControlFlow<()>

Source§

fn visit_arg(&mut self, arg: &Arg) -> ControlFlow<()>

Source§

fn visit_property_hook(&mut self, hook: &PropertyHook) -> ControlFlow<()>

Source§

fn visit_type_hint(&mut self, type_hint: &TypeHint) -> ControlFlow<()>

Source§

fn visit_attribute(&mut self, attribute: &Attribute) -> ControlFlow<()>

Source§

fn visit_catch_clause(&mut self, catch: &CatchClause) -> ControlFlow<()>

Source§

fn visit_match_arm(&mut self, arm: &MatchArm) -> ControlFlow<()>

Source§

fn visit_closure_use_var(&mut self, var: &ClosureUseVar) -> ControlFlow<()>

Source§

fn visit_trait_use(&mut self, trait_use: &TraitUseDecl) -> ControlFlow<()>

Source§

fn visit_trait_adaptation( &mut self, adaptation: &TraitAdaptation, ) -> ControlFlow<()>

Source§

fn visit_comment(&mut self, comment: &Comment) -> ControlFlow<()>

Source§

fn visit_block(&mut self, block: &Block) -> ControlFlow<()>

Source§

fn visit_name(&mut self, _name: &Name) -> ControlFlow<()>

Auto Trait Implementations§

§

impl<V> Freeze for OwnedScopeWalker<V>
where V: Freeze,

§

impl<V> RefUnwindSafe for OwnedScopeWalker<V>
where V: RefUnwindSafe,

§

impl<V> Send for OwnedScopeWalker<V>
where V: Send,

§

impl<V> Sync for OwnedScopeWalker<V>
where V: Sync,

§

impl<V> Unpin for OwnedScopeWalker<V>
where V: Unpin,

§

impl<V> UnsafeUnpin for OwnedScopeWalker<V>
where V: UnsafeUnpin,

§

impl<V> UnwindSafe for OwnedScopeWalker<V>
where V: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.