Trait code_gen::WithStatements
source · 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§
sourcefn statements(&self) -> &[Box<dyn Statement>]
fn statements(&self) -> &[Box<dyn Statement>]
Gets the statements.
sourcefn with_statement<S>(self, statement: S) -> Selfwhere
S: 'static + Statement,
fn with_statement<S>(self, statement: S) -> Selfwhere
S: 'static + Statement,
Adds the statement.
sourcefn add_statement<S>(&mut self, statement: S)where
S: 'static + Statement,
fn add_statement<S>(&mut self, statement: S)where
S: 'static + Statement,
Adds the statement.
Provided Methods§
sourcefn write_statements(&self, b: &mut CodeBuffer, level: usize)
fn write_statements(&self, b: &mut CodeBuffer, level: usize)
Writes the statements.
sourcefn write_curly_statement_block(&self, b: &mut CodeBuffer, level: usize)
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.