forge_fmt::visit

Trait Visitable

Source
pub trait Visitable {
    // Required method
    fn visit<V>(&mut self, v: &mut V) -> Result<(), V::Error>
       where V: Visitor;
}
Expand description

Visitable trait for [solang_parser::pt] types.

All [solang_parser::pt] types, such as [Statement], should implement the Visitable trait that accepts a trait Visitor implementation, which has various callback handles for Solidity Parse Tree nodes.

We want to take a &mut self to be able to implement some advanced features in the future such as modifying the Parse Tree before formatting it.

Required Methods§

Source

fn visit<V>(&mut self, v: &mut V) -> Result<(), V::Error>
where V: Visitor,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Visitable for Base

Source§

fn visit<V>(&mut self, v: &mut V) -> Result<(), V::Error>
where V: Visitor,

Source§

impl Visitable for ContractPart

Source§

fn visit<V>(&mut self, v: &mut V) -> Result<(), V::Error>
where V: Visitor,

Source§

impl Visitable for ErrorParameter

Source§

fn visit<V>(&mut self, v: &mut V) -> Result<(), V::Error>
where V: Visitor,

Source§

impl Visitable for EventParameter

Source§

fn visit<V>(&mut self, v: &mut V) -> Result<(), V::Error>
where V: Visitor,

Source§

impl Visitable for Expression

Source§

fn visit<V>(&mut self, v: &mut V) -> Result<(), V::Error>
where V: Visitor,

Source§

impl Visitable for FunctionAttribute

Source§

fn visit<V>(&mut self, v: &mut V) -> Result<(), V::Error>
where V: Visitor,

Source§

impl Visitable for Identifier

Source§

fn visit<V>(&mut self, v: &mut V) -> Result<(), V::Error>
where V: Visitor,

Source§

impl Visitable for IdentifierPath

Source§

fn visit<V>(&mut self, v: &mut V) -> Result<(), V::Error>
where V: Visitor,

Source§

impl Visitable for Import

Source§

fn visit<V>(&mut self, v: &mut V) -> Result<(), V::Error>
where V: Visitor,

Source§

impl Visitable for Loc

Source§

fn visit<V>(&mut self, v: &mut V) -> Result<(), V::Error>
where V: Visitor,

Source§

impl Visitable for Parameter

Source§

fn visit<V>(&mut self, v: &mut V) -> Result<(), V::Error>
where V: Visitor,

Source§

impl Visitable for SourceUnit

Source§

fn visit<V>(&mut self, v: &mut V) -> Result<(), V::Error>
where V: Visitor,

Source§

impl Visitable for SourceUnitPart

Source§

fn visit<V>(&mut self, v: &mut V) -> Result<(), V::Error>
where V: Visitor,

Source§

impl Visitable for Statement

Source§

fn visit<V>(&mut self, v: &mut V) -> Result<(), V::Error>
where V: Visitor,

Source§

impl Visitable for VariableAttribute

Source§

fn visit<V>(&mut self, v: &mut V) -> Result<(), V::Error>
where V: Visitor,

Source§

impl Visitable for VariableDeclaration

Source§

fn visit<V>(&mut self, v: &mut V) -> Result<(), V::Error>
where V: Visitor,

Source§

impl Visitable for YulBlock

Source§

fn visit<V>(&mut self, v: &mut V) -> Result<(), V::Error>
where V: Visitor,

Source§

impl Visitable for YulExpression

Source§

fn visit<V>(&mut self, v: &mut V) -> Result<(), V::Error>
where V: Visitor,

Source§

impl Visitable for YulStatement

Source§

fn visit<V>(&mut self, v: &mut V) -> Result<(), V::Error>
where V: Visitor,

Source§

impl Visitable for YulTypedIdentifier

Source§

fn visit<V>(&mut self, v: &mut V) -> Result<(), V::Error>
where V: Visitor,

Source§

impl<T> Visitable for Option<T>
where T: Visitable,

Source§

fn visit<V>(&mut self, v: &mut V) -> Result<(), V::Error>
where V: Visitor,

Source§

impl<T> Visitable for &mut T
where T: Visitable,

Source§

fn visit<V>(&mut self, v: &mut V) -> Result<(), V::Error>
where V: Visitor,

Source§

impl<T> Visitable for Box<T>
where T: Visitable,

Source§

fn visit<V>(&mut self, v: &mut V) -> Result<(), V::Error>
where V: Visitor,

Source§

impl<T> Visitable for Vec<T>
where T: Visitable,

Source§

fn visit<V>(&mut self, v: &mut V) -> Result<(), V::Error>
where V: Visitor,

Implementors§