Struct syntax::print::pprust::State[][src]

pub struct State<'a> {
    pub s: Printer<'a>,
    // some fields omitted
}

Fields

Methods

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

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

Pretty-print an item

Print an expr using syntax that's acceptable in a condition position, such as the cond in if cond { ... }.

Trait Implementations

impl<'a> PrintState<'a> for State<'a>
[src]

Important traits for Vec<u8>

This doesn't deserve to be called "pretty" printing, but it should be meaning-preserving. A quick hack that might help would be to look at the spans embedded in the TTs to decide where to put spaces and newlines. But it'd be better to parse these according to the grammar of the appropriate macro, transcribe back into the grammar we just parsed from, and then pretty-print the resulting AST nodes (so, e.g., we print expression arguments as expressions). It can be done! I think. Read more

Auto Trait Implementations

impl<'a> !Send for State<'a>

impl<'a> !Sync for State<'a>