Trait ParenthesizedNode

Source
pub trait ParenthesizedNode<'a> {
    // Required methods
    fn lpar(&self) -> &Vec<LeftParen<'a>>;
    fn rpar(&self) -> &Vec<RightParen<'a>>;
    fn with_parens(self, left: LeftParen<'a>, right: RightParen<'a>) -> Self;

    // Provided method
    fn parenthesize<F>(&self, state: &mut CodegenState<'a>, f: F)
       where F: FnOnce(&mut CodegenState<'a>) { ... }
}

Required Methods§

Source

fn lpar(&self) -> &Vec<LeftParen<'a>>

Source

fn rpar(&self) -> &Vec<RightParen<'a>>

Source

fn with_parens(self, left: LeftParen<'a>, right: RightParen<'a>) -> Self

Provided Methods§

Source

fn parenthesize<F>(&self, state: &mut CodegenState<'a>, f: F)
where F: FnOnce(&mut CodegenState<'a>),

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<'a, T: ParenthesizedNode<'a>> ParenthesizedNode<'a> for Box<T>

Source§

fn lpar(&self) -> &Vec<LeftParen<'a>>

Source§

fn rpar(&self) -> &Vec<RightParen<'a>>

Source§

fn parenthesize<F>(&self, state: &mut CodegenState<'a>, f: F)
where F: FnOnce(&mut CodegenState<'a>),

Source§

fn with_parens(self, left: LeftParen<'a>, right: RightParen<'a>) -> Self

Implementors§

Source§

impl<'a> ParenthesizedNode<'a> for AssignTargetExpression<'a>

Source§

impl<'a> ParenthesizedNode<'a> for DelTargetExpression<'a>

Source§

impl<'a> ParenthesizedNode<'a> for Expression<'a>

Source§

impl<'a> ParenthesizedNode<'a> for MatchPattern<'a>

Source§

impl<'a> ParenthesizedNode<'a> for MatchSequence<'a>

Source§

impl<'a> ParenthesizedNode<'a> for Attribute<'a>

Source§

impl<'a> ParenthesizedNode<'a> for Await<'a>

Source§

impl<'a> ParenthesizedNode<'a> for BinaryOperation<'a>

Source§

impl<'a> ParenthesizedNode<'a> for BooleanOperation<'a>

Source§

impl<'a> ParenthesizedNode<'a> for Call<'a>

Source§

impl<'a> ParenthesizedNode<'a> for Comparison<'a>

Source§

impl<'a> ParenthesizedNode<'a> for ConcatenatedString<'a>

Source§

impl<'a> ParenthesizedNode<'a> for Dict<'a>

Source§

impl<'a> ParenthesizedNode<'a> for DictComp<'a>

Source§

impl<'a> ParenthesizedNode<'a> for Ellipsis<'a>

Source§

impl<'a> ParenthesizedNode<'a> for Float<'a>

Source§

impl<'a> ParenthesizedNode<'a> for FormattedString<'a>

Source§

impl<'a> ParenthesizedNode<'a> for GeneratorExp<'a>

Source§

impl<'a> ParenthesizedNode<'a> for IfExp<'a>

Source§

impl<'a> ParenthesizedNode<'a> for Imaginary<'a>

Source§

impl<'a> ParenthesizedNode<'a> for Integer<'a>

Source§

impl<'a> ParenthesizedNode<'a> for Lambda<'a>

Source§

impl<'a> ParenthesizedNode<'a> for List<'a>

Source§

impl<'a> ParenthesizedNode<'a> for ListComp<'a>

Source§

impl<'a> ParenthesizedNode<'a> for MatchAs<'a>

Source§

impl<'a> ParenthesizedNode<'a> for MatchClass<'a>

Source§

impl<'a> ParenthesizedNode<'a> for MatchList<'a>

Source§

impl<'a> ParenthesizedNode<'a> for MatchMapping<'a>

Source§

impl<'a> ParenthesizedNode<'a> for MatchOr<'a>

Source§

impl<'a> ParenthesizedNode<'a> for MatchSingleton<'a>

Source§

impl<'a> ParenthesizedNode<'a> for MatchTuple<'a>

Source§

impl<'a> ParenthesizedNode<'a> for MatchValue<'a>

Source§

impl<'a> ParenthesizedNode<'a> for Name<'a>

Source§

impl<'a> ParenthesizedNode<'a> for NamedExpr<'a>

Source§

impl<'a> ParenthesizedNode<'a> for Set<'a>

Source§

impl<'a> ParenthesizedNode<'a> for SetComp<'a>

Source§

impl<'a> ParenthesizedNode<'a> for SimpleString<'a>

Source§

impl<'a> ParenthesizedNode<'a> for StarredElement<'a>

Source§

impl<'a> ParenthesizedNode<'a> for Subscript<'a>

Source§

impl<'a> ParenthesizedNode<'a> for Tuple<'a>

Source§

impl<'a> ParenthesizedNode<'a> for UnaryOperation<'a>

Source§

impl<'a> ParenthesizedNode<'a> for Yield<'a>