[−][src]Struct syntax::print::pprust::State
Fields
s: Printer<'a>
Methods
impl<'a> State<'a>
[src]
impl<'a> State<'a>
pub fn new_from_input( | [src] |
pub fn new( | [src] |
impl<'a> State<'a>
[src]
impl<'a> State<'a>
pub fn cbox(&mut self, u: usize) -> Result<()> | [src] |
pub fn word_nbsp<S: Into<Cow<'static, str>>>(&mut self, w: S) -> Result<()> | [src] |
pub fn head<S: Into<Cow<'static, str>>>(&mut self, w: S) -> Result<()> | [src] |
pub fn bopen(&mut self) -> Result<()> | [src] |
pub fn bclose_(&mut self, span: Span, indented: usize) -> Result<()> | [src] |
pub fn bclose_maybe_open( | [src] |
pub fn bclose(&mut self, span: Span) -> Result<()> | [src] |
pub fn in_cbox(&self) -> bool | [src] |
pub fn break_offset_if_not_bol(&mut self, n: usize, off: isize) -> Result<()> | [src] |
pub fn synth_comment(&mut self, text: String) -> Result<()> | [src] |
pub fn commasep_cmnt<T, F, G>( | [src] |
pub fn commasep_exprs(&mut self, b: Breaks, exprs: &[P<Expr>]) -> Result<()> | [src] |
pub fn print_mod(&mut self, _mod: &Mod, attrs: &[Attribute]) -> Result<()> | [src] |
pub fn print_foreign_mod( | [src] |
pub fn print_opt_lifetime(&mut self, lifetime: &Option<Lifetime>) -> Result<()> | [src] |
pub fn print_generic_arg(&mut self, generic_arg: &GenericArg) -> Result<()> | [src] |
pub fn print_type(&mut self, ty: &Ty) -> Result<()> | [src] |
pub fn print_foreign_item(&mut self, item: &ForeignItem) -> Result<()> | [src] |
pub fn print_item(&mut self, item: &Item) -> Result<()> | [src] |
Pretty-print an item
pub fn print_enum_def( | [src] |
pub fn print_variants(&mut self, variants: &[Variant], span: Span) -> Result<()> | [src] |
pub fn print_visibility(&mut self, vis: &Visibility) -> Result<()> | [src] |
pub fn print_defaultness(&mut self, defaultness: Defaultness) -> Result<()> | [src] |
pub fn print_struct( | [src] |
pub fn print_variant(&mut self, v: &Variant) -> Result<()> | [src] |
pub fn print_method_sig( | [src] |
pub fn print_trait_item(&mut self, ti: &TraitItem) -> Result<()> | [src] |
pub fn print_impl_item(&mut self, ii: &ImplItem) -> Result<()> | [src] |
pub fn print_stmt(&mut self, st: &Stmt) -> Result<()> | [src] |
pub fn print_block(&mut self, blk: &Block) -> Result<()> | [src] |
pub fn print_block_unclosed(&mut self, blk: &Block) -> Result<()> | [src] |
pub fn print_block_unclosed_with_attrs( | [src] |
pub fn print_block_unclosed_indent( | [src] |
pub fn print_block_with_attrs( | [src] |
pub fn print_block_maybe_unclosed( | [src] |
pub fn print_if( | [src] |
pub fn print_if_let( | [src] |
pub fn print_mac(&mut self, m: &Mac) -> Result<()> | [src] |
pub fn print_expr_maybe_paren(&mut self, expr: &Expr, prec: i8) -> Result<()> | [src] |
pub fn print_expr_as_cond(&mut self, expr: &Expr) -> Result<()> | [src] |
Print an expr using syntax that's acceptable in a condition position, such as the cond
in
if cond { ... }
.
pub fn print_expr(&mut self, expr: &Expr) -> Result<()> | [src] |
pub fn print_local_decl(&mut self, loc: &Local) -> Result<()> | [src] |
pub fn print_ident(&mut self, ident: Ident) -> Result<()> | [src] |
pub fn print_usize(&mut self, i: usize) -> Result<()> | [src] |
pub fn print_name(&mut self, name: Name) -> Result<()> | [src] |
pub fn print_for_decl(&mut self, loc: &Local, coll: &Expr) -> Result<()> | [src] |
pub fn print_pat(&mut self, pat: &Pat) -> Result<()> | [src] |
pub fn print_fn( | [src] |
pub fn print_fn_args_and_ret(&mut self, decl: &FnDecl) -> Result<()> | [src] |
pub fn print_fn_block_args(&mut self, decl: &FnDecl) -> Result<()> | [src] |
pub fn print_movability(&mut self, movability: Movability) -> Result<()> | [src] |
pub fn print_asyncness(&mut self, asyncness: IsAsync) -> Result<()> | [src] |
pub fn print_capture_clause(&mut self, capture_clause: CaptureBy) -> Result<()> | [src] |
pub fn print_type_bounds( | [src] |
pub fn print_lifetime(&mut self, lifetime: Lifetime) -> Result<()> | [src] |
pub fn print_lifetime_bounds( | [src] |
pub fn print_generic_params( | [src] |
pub fn print_where_clause(&mut self, where_clause: &WhereClause) -> Result<()> | [src] |
pub fn print_use_tree(&mut self, tree: &UseTree) -> Result<()> | [src] |
pub fn print_mutability(&mut self, mutbl: Mutability) -> Result<()> | [src] |
pub fn print_mt(&mut self, mt: &MutTy) -> Result<()> | [src] |
pub fn print_arg(&mut self, input: &Arg, is_closure: bool) -> Result<()> | [src] |
pub fn print_fn_output(&mut self, decl: &FnDecl) -> Result<()> | [src] |
pub fn print_ty_fn( | [src] |
pub fn maybe_print_trailing_comment( | [src] |
pub fn print_remaining_comments(&mut self) -> Result<()> | [src] |
pub fn print_opt_abi_and_extern_if_nondefault( | [src] |
pub fn print_extern_opt_abi(&mut self, opt_abi: Option<Abi>) -> Result<()> | [src] |
pub fn print_fn_header_info( | [src] |
pub fn print_unsafety(&mut self, s: Unsafety) -> Result<()> | [src] |
pub fn print_is_auto(&mut self, s: IsAuto) -> Result<()> | [src] |
Trait Implementations
impl<'a> PrintState<'a> for State<'a>
[src]
impl<'a> PrintState<'a> for State<'a>
fn writer(&mut self) -> &mut Printer<'a> | [src] |
fn boxes(&mut self) -> &mut Vec<Breaks> | [src] |
fn comments(&mut self) -> &mut Option<Vec<Comment>> | [src] |
fn cur_cmnt(&mut self) -> &mut usize | [src] |
fn cur_lit(&mut self) -> Option<&Literal> | [src] |
fn bump_lit(&mut self) -> Option<Literal> | [src] |
fn word_space<S: Into<Cow<'static, str>>>(&mut self, w: S) -> Result<()> | [src] |
fn popen(&mut self) -> Result<()> | [src] |
fn pclose(&mut self) -> Result<()> | [src] |
fn is_begin(&mut self) -> bool | [src] |
fn is_end(&mut self) -> bool | [src] |
fn is_bol(&mut self) -> bool | [src] |
fn hardbreak_if_not_bol(&mut self) -> Result<()> | [src] |
fn rbox(&mut self, u: usize, b: Breaks) -> Result<()> | [src] |
fn ibox(&mut self, u: usize) -> Result<()> | [src] |
fn end(&mut self) -> Result<()> | [src] |
fn commasep<T, F>(&mut self, b: Breaks, elts: &[T], op: F) -> Result<()> where | [src] |
fn next_lit(&mut self, pos: BytePos) -> Option<Literal> | [src] |
fn maybe_print_comment(&mut self, pos: BytePos) -> Result<()> | [src] |
fn print_comment(&mut self, cmnt: &Comment) -> Result<()> | [src] |
fn next_comment(&mut self) -> Option<Comment> | [src] |
fn print_literal(&mut self, lit: &Lit) -> Result<()> | [src] |
fn print_string(&mut self, st: &str, style: StrStyle) -> Result<()> | [src] |
fn print_inner_attributes(&mut self, attrs: &[Attribute]) -> Result<()> | [src] |
fn print_inner_attributes_no_trailing_hardbreak( | [src] |
fn print_outer_attributes(&mut self, attrs: &[Attribute]) -> Result<()> | [src] |
fn print_inner_attributes_inline(&mut self, attrs: &[Attribute]) -> Result<()> | [src] |
fn print_outer_attributes_inline(&mut self, attrs: &[Attribute]) -> Result<()> | [src] |
fn print_either_attributes( | [src] |
fn print_attribute_path(&mut self, path: &Path) -> Result<()> | [src] |
fn print_attribute(&mut self, attr: &Attribute) -> Result<()> | [src] |
fn print_attribute_inline( | [src] |
fn print_meta_list_item(&mut self, item: &NestedMetaItem) -> Result<()> | [src] |
fn print_meta_item(&mut self, item: &MetaItem) -> Result<()> | [src] |
fn print_tt(&mut self, tt: TokenTree) -> Result<()> | [src] |
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
fn print_tts(&mut self, tts: TokenStream) -> Result<()> | [src] |
fn space_if_not_bol(&mut self) -> Result<()> | [src] |
fn nbsp(&mut self) -> Result<()> | [src] |
fn print_dollar_crate(&mut self, ident: Ident) -> Result<()> | [src] |
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> | [src] |
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId | [src] |
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T | [src] |
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error> | [src] |
impl<E> SpecializationError for E
[src]
impl<E> SpecializationError for E
impl<T> Erased for T
[src]
impl<T> Erased for T
impl<T> Send for T where
T: ?Sized,
[src]
impl<T> Send for T where
T: ?Sized,
impl<T> Sync for T where
T: ?Sized,
[src]
impl<T> Sync for T where
T: ?Sized,
impl<T> Erased for T
impl<T> Erased for T