pub enum Code {
Line(String),
Block(Box<Block>),
Concat(Concat),
List(List),
}Expand description
Code structure
You should use the macros or into conversion instead of constructing this directly.
Variants§
Line(String)
A line of code.
Block(Box<Block>)
A block of code. See Block
Concat(Concat)
Concatenation of multiple code sections. See Concat
List(List)
A list of code segments with separator. See List
Implementations§
Trait Implementations§
Source§impl FormatCode for Code
impl FormatCode for Code
Source§fn format_into_vec_with(
&self,
format: &Format,
out: &mut Vec<String>,
connect: bool,
indent: &str,
)
fn format_into_vec_with( &self, format: &Format, out: &mut Vec<String>, connect: bool, indent: &str, )
Emit self with the format in the given output context
Source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
Upperbound for the line count of the code for pre-allocating. Return 0 to skip
Source§fn format_with(&self, format: &Format) -> String
fn format_with(&self, format: &Format) -> String
Emit self with the format as a string
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