pub enum Code {
Line(String),
Block(Box<Block>),
Concat(Vec<Code>),
}Expand description
Code enum
Variants§
Line(String)
A line of code.
The content shouldn’t contain the newline \n character.
It will be automatically inserted when formatting with Codize
Block(Box<Block>)
A block of code. See Block
Concat(Vec<Code>)
Concatenation of multiple code sections
Implementations§
source§impl Code
impl Code
pub fn block(block: Block) -> Self
sourcepub fn to_string_with(&self, codize: &Codize) -> String
pub fn to_string_with(&self, codize: &Codize) -> String
Convert the code to a String with the given formatting
Trait Implementations§
source§impl PartialEq for Code
impl PartialEq for Code
impl StructuralPartialEq for Code
Auto Trait Implementations§
impl Freeze for Code
impl RefUnwindSafe for Code
impl Send for Code
impl Sync for Code
impl Unpin for Code
impl UnwindSafe for Code
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