pub struct RustPrinter;Expand description
The Rust printer.
Trait Implementations§
Source§impl Default for RustPrinter
impl Default for RustPrinter
Source§fn default() -> RustPrinter
fn default() -> RustPrinter
Returns the “default value” for a type. Read more
Source§impl<'a, A: 'a> DocAllocator<'a, A> for RustPrinter
impl<'a, A: 'a> DocAllocator<'a, A> for RustPrinter
type Doc = BoxDoc<'a, A>
fn alloc(&'a self, doc: Doc<'a, Self::Doc, A>) -> Self::Doc
fn alloc_column_fn( &'a self, f: impl Fn(usize) -> Self::Doc + 'a, ) -> <Self::Doc as DocPtr<'a, A>>::ColumnFn
fn alloc_width_fn( &'a self, f: impl Fn(isize) -> Self::Doc + 'a, ) -> <Self::Doc as DocPtr<'a, A>>::WidthFn
fn alloc_cow(&'a self, doc: BuildDoc<'a, Self::Doc, A>) -> Self::Doc
Source§fn nil(&'a self) -> DocBuilder<'a, Self, A>
fn nil(&'a self) -> DocBuilder<'a, Self, A>
Allocate an empty document.
Source§fn fail(&'a self) -> DocBuilder<'a, Self, A>
fn fail(&'a self) -> DocBuilder<'a, Self, A>
Fails document rendering immediately. Read more
Source§fn hardline(&'a self) -> DocBuilder<'a, Self, A>
fn hardline(&'a self) -> DocBuilder<'a, Self, A>
Allocate a single hardline.
fn space(&'a self) -> DocBuilder<'a, Self, A>
Source§fn line(&'a self) -> DocBuilder<'a, Self, A>
fn line(&'a self) -> DocBuilder<'a, Self, A>
A line acts like a
\n but behaves like space if it is grouped on a single line.Source§fn line_(&'a self) -> DocBuilder<'a, Self, A>
fn line_(&'a self) -> DocBuilder<'a, Self, A>
Source§fn softline(&'a self) -> DocBuilder<'a, Self, A>
fn softline(&'a self) -> DocBuilder<'a, Self, A>
A
softline acts like space if the document fits the page, otherwise like lineSource§fn softline_(&'a self) -> DocBuilder<'a, Self, A>
fn softline_(&'a self) -> DocBuilder<'a, Self, A>
A
softline_ acts like nil if the document fits the page, otherwise like line_Source§fn as_string<U>(&'a self, data: U) -> DocBuilder<'a, Self, A>where
U: Display,
fn as_string<U>(&'a self, data: U) -> DocBuilder<'a, Self, A>where
U: Display,
Allocate a document containing the text
t.to_string(). Read moreSource§fn text<U>(&'a self, data: U) -> DocBuilder<'a, Self, A>
fn text<U>(&'a self, data: U) -> DocBuilder<'a, Self, A>
Allocate a document containing the given text. Read more
Source§fn concat<I>(&'a self, docs: I) -> DocBuilder<'a, Self, A>
fn concat<I>(&'a self, docs: I) -> DocBuilder<'a, Self, A>
Allocate a document concatenating the given documents.
Source§fn intersperse<I, S>(&'a self, docs: I, separator: S) -> DocBuilder<'a, Self, A>where
I: IntoIterator,
<I as IntoIterator>::Item: Pretty<'a, Self, A>,
S: Pretty<'a, Self, A> + Clone,
fn intersperse<I, S>(&'a self, docs: I, separator: S) -> DocBuilder<'a, Self, A>where
I: IntoIterator,
<I as IntoIterator>::Item: Pretty<'a, Self, A>,
S: Pretty<'a, Self, A> + Clone,
Allocate a document that intersperses the given separator
S between the given documents
[A, B, C, ..., Z], yielding [A, S, B, S, C, S, ..., S, Z]. Read moreSource§fn column(
&'a self,
f: impl Fn(usize) -> Self::Doc + 'a,
) -> DocBuilder<'a, Self, A>
fn column( &'a self, f: impl Fn(usize) -> Self::Doc + 'a, ) -> DocBuilder<'a, Self, A>
Allocate a document that acts differently based on the position and page layout Read more
Source§impl<'a, 'b, A: 'a + Clone> PrettyAst<'a, 'b, A> for RustPrinter
impl<'a, 'b, A: 'a + Clone> PrettyAst<'a, 'b, A> for RustPrinter
Source§const NAME: &'static str = "Rust"
const NAME: &'static str = "Rust"
A name for this instance of
PrettyAst.
Useful for diagnostics and debugging.Source§fn module(&'a self, module: &'b Module) -> DocBuilder<'a, Self, A>
fn module(&'a self, module: &'b Module) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn item(&'a self, item: &'b Item) -> DocBuilder<'a, Self, A>
fn item(&'a self, item: &'b Item) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn item_kind(&'a self, item_kind: &'b ItemKind) -> DocBuilder<'a, Self, A>
fn item_kind(&'a self, item_kind: &'b ItemKind) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn emit_diagnostic(&'a self, kind: Kind)
fn emit_diagnostic(&'a self, kind: Kind)
Emit a diagnostic with proper context and span.
Source§fn todo_document(
&'a self,
message: &str,
issue_id: Option<u32>,
) -> DocBuilder<'a, Self, A>
fn todo_document( &'a self, message: &str, issue_id: Option<u32>, ) -> DocBuilder<'a, Self, A>
Produce a non-panicking placeholder document. In general, prefer the use of the helper macro
todo_document!.Source§fn with_span<T>(&self, span: Span, action: impl Fn(&Self) -> T) -> T
fn with_span<T>(&self, span: Span, action: impl Fn(&Self) -> T) -> T
Execute an action with a span hint. Useful for errors.
Source§fn unimplemented_method(
&'a self,
method: &str,
ast: FragmentRef<'_>,
) -> DocBuilder<'a, Self, A>
fn unimplemented_method( &'a self, method: &str, ast: FragmentRef<'_>, ) -> DocBuilder<'a, Self, A>
Produce a structured error document for an unimplemented
method. Read more
Source§fn global_id(&'a self, global_id: &'b GlobalId) -> DocBuilder<'a, Self, A>
fn global_id(&'a self, global_id: &'b GlobalId) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn expr(&'a self, expr: &'b Expr) -> DocBuilder<'a, Self, A>
fn expr(&'a self, expr: &'b Expr) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn pat(&'a self, pat: &'b Pat) -> DocBuilder<'a, Self, A>
fn pat(&'a self, pat: &'b Pat) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn expr_kind(&'a self, expr_kind: &'b ExprKind) -> DocBuilder<'a, Self, A>
fn expr_kind(&'a self, expr_kind: &'b ExprKind) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn pat_kind(&'a self, pat_kind: &'b PatKind) -> DocBuilder<'a, Self, A>
fn pat_kind(&'a self, pat_kind: &'b PatKind) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn ty(&'a self, ty: &'b Ty) -> DocBuilder<'a, Self, A>
fn ty(&'a self, ty: &'b Ty) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn ty_kind(&'a self, ty_kind: &'b TyKind) -> DocBuilder<'a, Self, A>
fn ty_kind(&'a self, ty_kind: &'b TyKind) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn metadata(&'a self, metadata: &'b Metadata) -> DocBuilder<'a, Self, A>
fn metadata(&'a self, metadata: &'b Metadata) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn literal(&'a self, literal: &'b Literal) -> DocBuilder<'a, Self, A>
fn literal(&'a self, literal: &'b Literal) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn local_id(&'a self, local_id: &'b LocalId) -> DocBuilder<'a, Self, A>
fn local_id(&'a self, local_id: &'b LocalId) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn lhs(&'a self, lhs: &'b Lhs) -> DocBuilder<'a, Self, A>
fn lhs(&'a self, lhs: &'b Lhs) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn symbol(&'a self, symbol: &'b Symbol) -> DocBuilder<'a, Self, A>
fn symbol(&'a self, symbol: &'b Symbol) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn loop_kind(&'a self, loop_kind: &'b LoopKind) -> DocBuilder<'a, Self, A>
fn loop_kind(&'a self, loop_kind: &'b LoopKind) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn safety_kind(&'a self, safety_kind: &'b SafetyKind) -> DocBuilder<'a, Self, A>
fn safety_kind(&'a self, safety_kind: &'b SafetyKind) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn quote(&'a self, quote: &'b Quote) -> DocBuilder<'a, Self, A>
fn quote(&'a self, quote: &'b Quote) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn spanned_ty(&'a self, spanned_ty: &'b SpannedTy) -> DocBuilder<'a, Self, A>
fn spanned_ty(&'a self, spanned_ty: &'b SpannedTy) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn binding_mode(
&'a self,
binding_mode: &'b BindingMode,
) -> DocBuilder<'a, Self, A>
fn binding_mode( &'a self, binding_mode: &'b BindingMode, ) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn primitive_ty(
&'a self,
primitive_ty: &'b PrimitiveTy,
) -> DocBuilder<'a, Self, A>
fn primitive_ty( &'a self, primitive_ty: &'b PrimitiveTy, ) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn region(&'a self, region: &'b Region) -> DocBuilder<'a, Self, A>
fn region(&'a self, region: &'b Region) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn impl_expr(&'a self, impl_expr: &'b ImplExpr) -> DocBuilder<'a, Self, A>
fn impl_expr(&'a self, impl_expr: &'b ImplExpr) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn int_kind(&'a self, int_kind: &'b IntKind) -> DocBuilder<'a, Self, A>
fn int_kind(&'a self, int_kind: &'b IntKind) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn float_kind(&'a self, float_kind: &'b FloatKind) -> DocBuilder<'a, Self, A>
fn float_kind(&'a self, float_kind: &'b FloatKind) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn generic_value(
&'a self,
generic_value: &'b GenericValue,
) -> DocBuilder<'a, Self, A>
fn generic_value( &'a self, generic_value: &'b GenericValue, ) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn arm(&'a self, arm: &'b Arm) -> DocBuilder<'a, Self, A>
fn arm(&'a self, arm: &'b Arm) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn loop_state(&'a self, loop_state: &'b LoopState) -> DocBuilder<'a, Self, A>
fn loop_state(&'a self, loop_state: &'b LoopState) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn control_flow_kind(
&'a self,
control_flow_kind: &'b ControlFlowKind,
) -> DocBuilder<'a, Self, A>
fn control_flow_kind( &'a self, control_flow_kind: &'b ControlFlowKind, ) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn dyn_trait_goal(
&'a self,
dyn_trait_goal: &'b DynTraitGoal,
) -> DocBuilder<'a, Self, A>
fn dyn_trait_goal( &'a self, dyn_trait_goal: &'b DynTraitGoal, ) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn attribute(&'a self, attribute: &'b Attribute) -> DocBuilder<'a, Self, A>
fn attribute(&'a self, attribute: &'b Attribute) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn quote_content(
&'a self,
quote_content: &'b QuoteContent,
) -> DocBuilder<'a, Self, A>
fn quote_content( &'a self, quote_content: &'b QuoteContent, ) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn borrow_kind(&'a self, borrow_kind: &'b BorrowKind) -> DocBuilder<'a, Self, A>
fn borrow_kind(&'a self, borrow_kind: &'b BorrowKind) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn trait_goal(&'a self, trait_goal: &'b TraitGoal) -> DocBuilder<'a, Self, A>
fn trait_goal(&'a self, trait_goal: &'b TraitGoal) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn impl_expr_kind(
&'a self,
impl_expr_kind: &'b ImplExprKind,
) -> DocBuilder<'a, Self, A>
fn impl_expr_kind( &'a self, impl_expr_kind: &'b ImplExprKind, ) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn int_size(&'a self, int_size: &'b IntSize) -> DocBuilder<'a, Self, A>
fn int_size(&'a self, int_size: &'b IntSize) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn signedness(&'a self, signedness: &'b Signedness) -> DocBuilder<'a, Self, A>
fn signedness(&'a self, signedness: &'b Signedness) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn guard(&'a self, guard: &'b Guard) -> DocBuilder<'a, Self, A>
fn guard(&'a self, guard: &'b Guard) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn attribute_kind(
&'a self,
attribute_kind: &'b AttributeKind,
) -> DocBuilder<'a, Self, A>
fn attribute_kind( &'a self, attribute_kind: &'b AttributeKind, ) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn guard_kind(&'a self, guard_kind: &'b GuardKind) -> DocBuilder<'a, Self, A>
fn guard_kind(&'a self, guard_kind: &'b GuardKind) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn impl_item(&'a self, impl_item: &'b ImplItem) -> DocBuilder<'a, Self, A>
fn impl_item(&'a self, impl_item: &'b ImplItem) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn impl_item_kind(
&'a self,
impl_item_kind: &'b ImplItemKind,
) -> DocBuilder<'a, Self, A>
fn impl_item_kind( &'a self, impl_item_kind: &'b ImplItemKind, ) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn trait_item(&'a self, trait_item: &'b TraitItem) -> DocBuilder<'a, Self, A>
fn trait_item(&'a self, trait_item: &'b TraitItem) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn trait_item_kind(
&'a self,
trait_item_kind: &'b TraitItemKind,
) -> DocBuilder<'a, Self, A>
fn trait_item_kind( &'a self, trait_item_kind: &'b TraitItemKind, ) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn item_quote_origin(
&'a self,
item_quote_origin: &'b ItemQuoteOrigin,
) -> DocBuilder<'a, Self, A>
fn item_quote_origin( &'a self, item_quote_origin: &'b ItemQuoteOrigin, ) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn item_quote_origin_kind(
&'a self,
item_quote_origin_kind: &'b ItemQuoteOriginKind,
) -> DocBuilder<'a, Self, A>
fn item_quote_origin_kind( &'a self, item_quote_origin_kind: &'b ItemQuoteOriginKind, ) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn item_quote_origin_position(
&'a self,
item_quote_origin_position: &'b ItemQuoteOriginPosition,
) -> DocBuilder<'a, Self, A>
fn item_quote_origin_position( &'a self, item_quote_origin_position: &'b ItemQuoteOriginPosition, ) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn generic_param_kind(
&'a self,
generic_param_kind: &'b GenericParamKind,
) -> DocBuilder<'a, Self, A>
fn generic_param_kind( &'a self, generic_param_kind: &'b GenericParamKind, ) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn impl_ident(&'a self, impl_ident: &'b ImplIdent) -> DocBuilder<'a, Self, A>
fn impl_ident(&'a self, impl_ident: &'b ImplIdent) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn projection_predicate(
&'a self,
projection_predicate: &'b ProjectionPredicate,
) -> DocBuilder<'a, Self, A>
fn projection_predicate( &'a self, projection_predicate: &'b ProjectionPredicate, ) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn generic_param(
&'a self,
generic_param: &'b GenericParam,
) -> DocBuilder<'a, Self, A>
fn generic_param( &'a self, generic_param: &'b GenericParam, ) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn generics(&'a self, generics: &'b Generics) -> DocBuilder<'a, Self, A>
fn generics(&'a self, generics: &'b Generics) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn doc_comment_kind(
&'a self,
doc_comment_kind: &'b DocCommentKind,
) -> DocBuilder<'a, Self, A>
fn doc_comment_kind( &'a self, doc_comment_kind: &'b DocCommentKind, ) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn param(&'a self, param: &'b Param) -> DocBuilder<'a, Self, A>
fn param(&'a self, param: &'b Param) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn variant(&'a self, variant: &'b Variant) -> DocBuilder<'a, Self, A>
fn variant(&'a self, variant: &'b Variant) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn generic_constraint(
&'a self,
generic_constraint: &'b GenericConstraint,
) -> DocBuilder<'a, Self, A>
fn generic_constraint( &'a self, generic_constraint: &'b GenericConstraint, ) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn error_node(&'a self, error_node: &'b ErrorNode) -> DocBuilder<'a, Self, A>
fn error_node(&'a self, error_node: &'b ErrorNode) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn resugared_expr_kind(
&'a self,
resugared_expr_kind: &'b ResugaredExprKind,
) -> DocBuilder<'a, Self, A>
fn resugared_expr_kind( &'a self, resugared_expr_kind: &'b ResugaredExprKind, ) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn resugared_ty_kind(
&'a self,
resugared_ty_kind: &'b ResugaredTyKind,
) -> DocBuilder<'a, Self, A>
fn resugared_ty_kind( &'a self, resugared_ty_kind: &'b ResugaredTyKind, ) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn resugared_pat_kind(
&'a self,
resugared_pat_kind: &'b ResugaredPatKind,
) -> DocBuilder<'a, Self, A>
fn resugared_pat_kind( &'a self, resugared_pat_kind: &'b ResugaredPatKind, ) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn resugared_impl_item_kind(
&'a self,
resugared_impl_item_kind: &'b ResugaredImplItemKind,
) -> DocBuilder<'a, Self, A>
fn resugared_impl_item_kind( &'a self, resugared_impl_item_kind: &'b ResugaredImplItemKind, ) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn resugared_trait_item_kind(
&'a self,
resugared_trait_item_kind: &'b ResugaredTraitItemKind,
) -> DocBuilder<'a, Self, A>
fn resugared_trait_item_kind( &'a self, resugared_trait_item_kind: &'b ResugaredTraitItemKind, ) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§fn resugared_item_kind(
&'a self,
resugared_item_kind: &'b ResugaredItemKind,
) -> DocBuilder<'a, Self, A>
fn resugared_item_kind( &'a self, resugared_item_kind: &'b ResugaredItemKind, ) -> DocBuilder<'a, Self, A>
👎Deprecated: Do not call this method directly. Use [
pretty::Pretty::pretty] instead, so annotations/spans are preserved correctly.Define how the printer formats a value of this AST type.
Do not call this method directly. Use
pretty::Pretty::pretty instead, so annotations/spans are preserved correctly.Source§impl Printer for RustPrinter
impl Printer for RustPrinter
Source§fn resugaring_phases() -> Vec<Box<dyn Resugaring>>
fn resugaring_phases() -> Vec<Box<dyn Resugaring>>
A list of resugaring phases.
Auto Trait Implementations§
impl Freeze for RustPrinter
impl RefUnwindSafe for RustPrinter
impl Send for RustPrinter
impl Sync for RustPrinter
impl Unpin for RustPrinter
impl UnwindSafe for RustPrinter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more