[][src]Struct codegen_rs::Formatter

pub struct Formatter<'a> { /* fields omitted */ }

Configures how a scope is formatted.

Implementations

impl<'a> Formatter<'a>[src]

pub fn new(dst: &'a mut String) -> Self[src]

Return a new formatter that writes to the given string.

pub fn block<F>(&mut self, f: F) -> Result where
    F: FnOnce(&mut Self) -> Result
[src]

Wrap the given function inside a block.

pub fn indent<F, R>(&mut self, f: F) -> R where
    F: FnOnce(&mut Self) -> R, 
[src]

Call the given function with the indentation level incremented by one.

pub fn is_start_of_line(&self) -> bool[src]

Check if current destination is the start of a new line.

Trait Implementations

impl<'a> Debug for Formatter<'a>[src]

impl<'a> Write for Formatter<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Formatter<'a>[src]

impl<'a> Send for Formatter<'a>[src]

impl<'a> Sync for Formatter<'a>[src]

impl<'a> Unpin for Formatter<'a>[src]

impl<'a> !UnwindSafe for Formatter<'a>[src]

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, 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.