pub struct Source { /* private fields */ }
Expand description
Represents general source code.
Trait Implementations§
Source§impl Statement for Source
impl Statement for Source
Source§fn write(&self, b: &mut CodeBuffer, level: usize)
fn write(&self, b: &mut CodeBuffer, level: usize)
Writes the code to the buffer
b
at the indent level
.Source§impl WithStatements for Source
impl WithStatements for Source
Source§fn statements(&self) -> &[Box<dyn Statement>]
fn statements(&self) -> &[Box<dyn Statement>]
Gets the statements.
Source§fn add_boxed_statement(&mut self, statement: Box<dyn Statement>)
fn add_boxed_statement(&mut self, statement: Box<dyn Statement>)
Adds the boxed
statement
.Source§fn with_boxed_statement(self, statement: Box<dyn Statement>) -> Self
fn with_boxed_statement(self, statement: Box<dyn Statement>) -> Self
Adds the boxed
statement
.Source§fn 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
.Source§fn with_statement<S>(self, statement: S) -> Selfwhere
S: 'static + Statement,
fn with_statement<S>(self, statement: S) -> Selfwhere
S: 'static + Statement,
Adds the
statement
.Source§fn add_literal<L>(&mut self, literal: L)
fn add_literal<L>(&mut self, literal: L)
Adds the
literal
statement.Source§fn with_literal<L>(self, literal: L) -> Self
fn with_literal<L>(self, literal: L) -> Self
Adds the
literal
statement.Source§fn add_expression_statement<E>(&mut self, expression: E)where
E: 'static + Expression,
fn add_expression_statement<E>(&mut self, expression: E)where
E: 'static + Expression,
Adds the
expression
as a statement.Source§fn with_expression_statement<E>(self, expression: E) -> Selfwhere
E: 'static + Expression,
fn with_expression_statement<E>(self, expression: E) -> Selfwhere
E: 'static + Expression,
Adds the
expression
as a statement.Source§fn write_statements(&self, b: &mut CodeBuffer, level: usize)
fn write_statements(&self, b: &mut CodeBuffer, level: usize)
Writes the statements.
Source§fn write_curly_statement_block(&self, b: &mut CodeBuffer, level: usize)
fn write_curly_statement_block(&self, b: &mut CodeBuffer, level: usize)
Writes the curly-bracketed statement block. (
level
is the outer level)Auto Trait Implementations§
impl Freeze for Source
impl !RefUnwindSafe for Source
impl !Send for Source
impl !Sync for Source
impl Unpin for Source
impl !UnwindSafe for Source
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more