[][src]Trait syntax::print::pprust::PrintState

pub trait PrintState<'a>: Deref<Target = Printer> + DerefMut {
    fn comments(&mut self) -> &mut Option<Comments<'a>>;
fn print_ident(&mut self, ident: Ident);
fn print_generic_args(
        &mut self,
        args: &GenericArgs,
        colons_before_params: bool
    ); fn strsep<T, F>(
        &mut self,
        sep: &'static str,
        space_before: bool,
        b: Breaks,
        elts: &[T],
        op: F
    )
    where
        F: FnMut(&mut Self, &T)
, { ... }
fn commasep<T, F>(&mut self, b: Breaks, elts: &[T], op: F)
    where
        F: FnMut(&mut Self, &T)
, { ... }
fn maybe_print_comment(&mut self, pos: BytePos) { ... }
fn print_comment(&mut self, cmnt: &Comment) { ... }
fn next_comment(&mut self) -> Option<Comment> { ... }
fn print_literal(&mut self, lit: &Lit) { ... }
fn print_string(&mut self, st: &str, style: StrStyle) { ... }
fn print_inner_attributes(&mut self, attrs: &[Attribute]) { ... }
fn print_inner_attributes_no_trailing_hardbreak(
        &mut self,
        attrs: &[Attribute]
    ) { ... }
fn print_outer_attributes(&mut self, attrs: &[Attribute]) { ... }
fn print_inner_attributes_inline(&mut self, attrs: &[Attribute]) { ... }
fn print_outer_attributes_inline(&mut self, attrs: &[Attribute]) { ... }
fn print_either_attributes(
        &mut self,
        attrs: &[Attribute],
        kind: AttrStyle,
        is_inline: bool,
        trailing_hardbreak: bool
    ) { ... }
fn print_attribute(&mut self, attr: &Attribute) { ... }
fn print_attribute_inline(&mut self, attr: &Attribute, is_inline: bool) { ... }
fn print_attr_item(&mut self, item: &AttrItem, span: Span) { ... }
fn print_meta_list_item(&mut self, item: &NestedMetaItem) { ... }
fn print_meta_item(&mut self, item: &MetaItem) { ... }
fn print_tt(&mut self, tt: TokenTree, convert_dollar_crate: bool) { ... }
fn print_tts(&mut self, tts: TokenStream, convert_dollar_crate: bool) { ... }
fn print_mac_common(
        &mut self,
        header: Option<MacHeader>,
        has_bang: bool,
        ident: Option<Ident>,
        delim: DelimToken,
        tts: TokenStream,
        convert_dollar_crate: bool,
        span: Span
    ) { ... }
fn print_path(
        &mut self,
        path: &Path,
        colons_before_params: bool,
        depth: usize
    ) { ... }
fn print_path_segment(
        &mut self,
        segment: &PathSegment,
        colons_before_params: bool
    ) { ... }
fn head<S: Into<Cow<'static, str>>>(&mut self, w: S) { ... }
fn bopen(&mut self) { ... }
fn bclose_maybe_open(&mut self, span: Span, close_box: bool) { ... }
fn bclose(&mut self, span: Span) { ... }
fn break_offset_if_not_bol(&mut self, n: usize, off: isize) { ... } }
⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Required methods

fn comments(&mut self) -> &mut Option<Comments<'a>>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn print_ident(&mut self, ident: Ident)

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn print_generic_args(&mut self, args: &GenericArgs, colons_before_params: bool)

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Loading content...

Provided methods

fn strsep<T, F>(
    &mut self,
    sep: &'static str,
    space_before: bool,
    b: Breaks,
    elts: &[T],
    op: F
) where
    F: FnMut(&mut Self, &T), 

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn commasep<T, F>(&mut self, b: Breaks, elts: &[T], op: F) where
    F: FnMut(&mut Self, &T), 

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn maybe_print_comment(&mut self, pos: BytePos)

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn print_comment(&mut self, cmnt: &Comment)

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn next_comment(&mut self) -> Option<Comment>

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn print_literal(&mut self, lit: &Lit)

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn print_string(&mut self, st: &str, style: StrStyle)

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn print_inner_attributes(&mut self, attrs: &[Attribute])

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn print_inner_attributes_no_trailing_hardbreak(&mut self, attrs: &[Attribute])

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn print_outer_attributes(&mut self, attrs: &[Attribute])

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn print_inner_attributes_inline(&mut self, attrs: &[Attribute])

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn print_outer_attributes_inline(&mut self, attrs: &[Attribute])

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn print_either_attributes(
    &mut self,
    attrs: &[Attribute],
    kind: AttrStyle,
    is_inline: bool,
    trailing_hardbreak: bool
)

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn print_attribute(&mut self, attr: &Attribute)

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn print_attribute_inline(&mut self, attr: &Attribute, is_inline: bool)

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn print_attr_item(&mut self, item: &AttrItem, span: Span)

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn print_meta_list_item(&mut self, item: &NestedMetaItem)

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn print_meta_item(&mut self, item: &MetaItem)

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn print_tt(&mut self, tt: TokenTree, convert_dollar_crate: bool)

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

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.

fn print_tts(&mut self, tts: TokenStream, convert_dollar_crate: bool)

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn print_mac_common(
    &mut self,
    header: Option<MacHeader>,
    has_bang: bool,
    ident: Option<Ident>,
    delim: DelimToken,
    tts: TokenStream,
    convert_dollar_crate: bool,
    span: Span
)

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn print_path(&mut self, path: &Path, colons_before_params: bool, depth: usize)

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn print_path_segment(
    &mut self,
    segment: &PathSegment,
    colons_before_params: bool
)

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn head<S: Into<Cow<'static, str>>>(&mut self, w: S)

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn bopen(&mut self)

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn bclose_maybe_open(&mut self, span: Span, close_box: bool)

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn bclose(&mut self, span: Span)

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

fn break_offset_if_not_bol(&mut self, n: usize, off: isize)

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

Loading content...

Implementors

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

Loading content...