Struct code_gen::CodeBuffer
source · pub struct CodeBuffer { /* private fields */ }
Expand description
Responsible for buffering code.
Implementations§
source§impl CodeBuffer
impl CodeBuffer
Constants
sourcepub const DEFAULT_INDENT: &'static str = " "
pub const DEFAULT_INDENT: &'static str = " "
The default indent. (4 spaces)
sourcepub const DEFAULT_LINE_ENDING: &'static str = "\n"
pub const DEFAULT_LINE_ENDING: &'static str = "\n"
The default line-ending.
sourcepub const DEFAULT_CAPACITY: usize = 4_096usize
pub const DEFAULT_CAPACITY: usize = 4_096usize
The default buffer capacity.
source§impl CodeBuffer
impl CodeBuffer
Construction
source§impl CodeBuffer
impl CodeBuffer
Writing
source§impl CodeBuffer
impl CodeBuffer
Access
source§impl CodeBuffer
impl CodeBuffer
Display
sourcepub fn display_statement<S>(statement: &S) -> Stringwhere
S: Statement,
pub fn display_statement<S>(statement: &S) -> Stringwhere
S: Statement,
Converts the statement to a string using the default code buffer.
sourcepub fn display_expression<E>(expression: &E) -> Stringwhere
E: Expression,
pub fn display_expression<E>(expression: &E) -> Stringwhere
E: Expression,
Converts the expression to a string using the default code buffer.
Trait Implementations§
source§impl Clone for CodeBuffer
impl Clone for CodeBuffer
source§fn clone(&self) -> CodeBuffer
fn clone(&self) -> CodeBuffer
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for CodeBuffer
impl Debug for CodeBuffer
source§impl Default for CodeBuffer
impl Default for CodeBuffer
Auto Trait Implementations§
impl RefUnwindSafe for CodeBuffer
impl Send for CodeBuffer
impl Sync for CodeBuffer
impl Unpin for CodeBuffer
impl UnwindSafe for CodeBuffer
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