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 Clone for Indentation
impl Clone for Indentation
source§fn clone(&self) -> Indentation
fn clone(&self) -> Indentation
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 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)