[][src]Enum genco::fmt::Indentation

pub enum Indentation {
    Space(usize),
    Tab,
}

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

impl Clone for Indentation[src]

impl Copy for Indentation[src]

impl Debug for Indentation[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.