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 Clone for Indentation
impl Clone for Indentation
Source§fn clone(&self) -> Indentation
fn clone(&self) -> Indentation
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl CodeGenerate for Indentation
impl CodeGenerate for Indentation
impl Copy 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