Struct code_generator::Indentation
source · pub struct Indentation {}Expand description
Indentation generator
This struct will use the context of the generator to decide how to generate
When using this generator you should assume that any necessary indentation before your generator has already been created. i.e. generate indentation for all lines except the first since that indentation would be generated by the parent generator. You will only need to use this when you create a multiline generator which does not use the existing code structure generators.
Implementations§
source§impl Indentation
impl Indentation
sourcepub fn new() -> Indentation
pub fn new() -> Indentation
Creates an indentation generator
This should not be used if you want a specific amount/type of indentation
let indent = Indentation::new();
let info = CodeGenerationInfo::from_style(CodeStyle::KnR).indent();
assert_eq!(" ", format!("{}", indent.display(info)));Trait Implementations§
source§impl CodeGenerate for Indentation
impl CodeGenerate for Indentation
Auto Trait Implementations§
impl Freeze for Indentation
impl RefUnwindSafe for Indentation
impl Send for Indentation
impl Sync for Indentation
impl Unpin for Indentation
impl UnwindSafe for Indentation
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