Enum genco::fmt::Indentation
source · [−]pub enum Indentation {
Space(usize),
Tab,
}
Expand description
Indentation configuration.
use genco::prelude::*;
use genco::fmt;
let tokens: rust::Tokens = quote! {
fn foo() -> u32 {
42u32
}
};
let mut w = fmt::VecWriter::new();
let fmt = fmt::Config::from_lang::<Rust>()
.with_indentation(fmt::Indentation::Tab);
let config = rust::Config::default();
tokens.format_file(&mut w.as_formatter(&fmt), &config)?;
assert_eq! {
vec![
"fn foo() -> u32 {",
"\t42u32",
"}",
],
w.into_vec(),
};
Variants
Space(usize)
Each indentation is the given number of spaces.
Tab
Each indentation is a tab.
Trait Implementations
sourceimpl Clone for Indentation
impl Clone for Indentation
sourcefn clone(&self) -> Indentation
fn clone(&self) -> Indentation
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for Indentation
impl Debug for Indentation
impl Copy for Indentation
Auto Trait Implementations
impl RefUnwindSafe for Indentation
impl Send for Indentation
impl Sync for Indentation
impl Unpin for Indentation
impl UnwindSafe for Indentation
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more