pub trait WithStatements {
    // Required methods
    fn statements(&self) -> &[Box<dyn Statement>];
    fn with_statement<S>(self, statement: S) -> Self
       where S: 'static + Statement;
    fn add_statement<S>(&mut self, statement: S)
       where S: 'static + Statement;

    // Provided methods
    fn write_statements(&self, b: &mut CodeBuffer, level: usize) { ... }
    fn write_curly_statement_block(&self, b: &mut CodeBuffer, level: usize) { ... }
}
Expand description

An element with statements.

Required Methods§

source

fn statements(&self) -> &[Box<dyn Statement>]

Gets the statements.

source

fn with_statement<S>(self, statement: S) -> Self
where S: 'static + Statement,

Adds the statement.

source

fn add_statement<S>(&mut self, statement: S)
where S: 'static + Statement,

Adds the statement.

Provided Methods§

source

fn write_statements(&self, b: &mut CodeBuffer, level: usize)

Writes the statements.

source

fn write_curly_statement_block(&self, b: &mut CodeBuffer, level: usize)

Writes the curly-bracket statement block.

Object Safety§

This trait is not object safe.

Implementors§