pub struct RustPrinter(/* private fields */);Expand description
The Rust printer.
Trait Implementations§
Source§impl Clone for RustPrinter
impl Clone for RustPrinter
Source§fn clone(&self) -> RustPrinter
fn clone(&self) -> RustPrinter
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§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 HasContextualSpan for RustPrinter
impl HasContextualSpan for RustPrinter
Source§impl HasLinkedItemGraph for RustPrinter
impl HasLinkedItemGraph for RustPrinter
Source§fn linked_item_graph(&self) -> &LinkedItemGraph
fn linked_item_graph(&self) -> &LinkedItemGraph
Get a reference of the
LinkedItemGraph.Source§fn with_linked_item_graph(self, graph: Rc<LinkedItemGraph>) -> Self
fn with_linked_item_graph(self, graph: Rc<LinkedItemGraph>) -> Self
Set a
LinkedItemGraph.Source§impl<A: 'static + Clone> PrettyAst<A> for RustPrinter
impl<A: 'static + Clone> PrettyAst<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(&self, module: &Module) -> DocBuilder<A>
fn module(&self, module: &Module) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn item(&self, item: &Item) -> DocBuilder<A>
fn item(&self, item: &Item) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn item_kind(&self, item_kind: &ItemKind) -> DocBuilder<A>
fn item_kind(&self, item_kind: &ItemKind) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn emit_diagnostic(&self, kind: Kind)
fn emit_diagnostic(&self, kind: Kind)
Emit a diagnostic with proper context and span.
Source§fn todo_document(&self, message: &str, issue_id: Option<u32>) -> DocBuilder<A>
fn todo_document(&self, message: &str, issue_id: Option<u32>) -> DocBuilder<A>
Produce a non-panicking placeholder document. In general, prefer the use of the helper macro
todo_document!.Source§fn unimplemented_method(
&self,
method: &str,
ast: FragmentRef<'_>,
) -> DocBuilder<A>
fn unimplemented_method( &self, method: &str, ast: FragmentRef<'_>, ) -> DocBuilder<A>
Produce a structured error document for an unimplemented
method. Read more
Source§fn global_id(&self, global_id: &GlobalId) -> DocBuilder<A>
fn global_id(&self, global_id: &GlobalId) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn expr(&self, expr: &Expr) -> DocBuilder<A>
fn expr(&self, expr: &Expr) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn pat(&self, pat: &Pat) -> DocBuilder<A>
fn pat(&self, pat: &Pat) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn ty(&self, ty: &Ty) -> DocBuilder<A>
fn ty(&self, ty: &Ty) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn metadata(&self, metadata: &Metadata) -> DocBuilder<A>
fn metadata(&self, metadata: &Metadata) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn literal(&self, literal: &Literal) -> DocBuilder<A>
fn literal(&self, literal: &Literal) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn local_id(&self, local_id: &LocalId) -> DocBuilder<A>
fn local_id(&self, local_id: &LocalId) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn lhs(&self, lhs: &Lhs) -> DocBuilder<A>
fn lhs(&self, lhs: &Lhs) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn symbol(&self, symbol: &Symbol) -> DocBuilder<A>
fn symbol(&self, symbol: &Symbol) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn safety_kind(&self, safety_kind: &SafetyKind) -> DocBuilder<A>
fn safety_kind(&self, safety_kind: &SafetyKind) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn quote(&self, quote: &Quote) -> DocBuilder<A>
fn quote(&self, quote: &Quote) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn spanned_ty(&self, spanned_ty: &SpannedTy) -> DocBuilder<A>
fn spanned_ty(&self, spanned_ty: &SpannedTy) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn binding_mode(&self, binding_mode: &BindingMode) -> DocBuilder<A>
fn binding_mode(&self, binding_mode: &BindingMode) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn primitive_ty(&self, primitive_ty: &PrimitiveTy) -> DocBuilder<A>
fn primitive_ty(&self, primitive_ty: &PrimitiveTy) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn region(&self, region: &Region) -> DocBuilder<A>
fn region(&self, region: &Region) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn impl_expr(&self, impl_expr: &ImplExpr) -> DocBuilder<A>
fn impl_expr(&self, impl_expr: &ImplExpr) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn int_kind(&self, int_kind: &IntKind) -> DocBuilder<A>
fn int_kind(&self, int_kind: &IntKind) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn float_kind(&self, float_kind: &FloatKind) -> DocBuilder<A>
fn float_kind(&self, float_kind: &FloatKind) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn generic_value(&self, generic_value: &GenericValue) -> DocBuilder<A>
fn generic_value(&self, generic_value: &GenericValue) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn arm(&self, arm: &Arm) -> DocBuilder<A>
fn arm(&self, arm: &Arm) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn dyn_trait_goal(&self, dyn_trait_goal: &DynTraitGoal) -> DocBuilder<A>
fn dyn_trait_goal(&self, dyn_trait_goal: &DynTraitGoal) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn attribute(&self, attribute: &Attribute) -> DocBuilder<A>
fn attribute(&self, attribute: &Attribute) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn quote_content(&self, quote_content: &QuoteContent) -> DocBuilder<A>
fn quote_content(&self, quote_content: &QuoteContent) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn borrow_kind(&self, borrow_kind: &BorrowKind) -> DocBuilder<A>
fn borrow_kind(&self, borrow_kind: &BorrowKind) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn trait_goal(&self, trait_goal: &TraitGoal) -> DocBuilder<A>
fn trait_goal(&self, trait_goal: &TraitGoal) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn guard(&self, guard: &Guard) -> DocBuilder<A>
fn guard(&self, guard: &Guard) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn impl_item(&self, impl_item: &ImplItem) -> DocBuilder<A>
fn impl_item(&self, impl_item: &ImplItem) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn trait_item(&self, trait_item: &TraitItem) -> DocBuilder<A>
fn trait_item(&self, trait_item: &TraitItem) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn generic_param_kind(
&self,
generic_param_kind: &GenericParamKind,
) -> DocBuilder<A>
fn generic_param_kind( &self, generic_param_kind: &GenericParamKind, ) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn impl_ident(&self, impl_ident: &ImplIdent) -> DocBuilder<A>
fn impl_ident(&self, impl_ident: &ImplIdent) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn projection_predicate(
&self,
projection_predicate: &ProjectionPredicate,
) -> DocBuilder<A>
fn projection_predicate( &self, projection_predicate: &ProjectionPredicate, ) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn generic_param(&self, generic_param: &GenericParam) -> DocBuilder<A>
fn generic_param(&self, generic_param: &GenericParam) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn generics(&self, generics: &Generics) -> DocBuilder<A>
fn generics(&self, generics: &Generics) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn param(&self, param: &Param) -> DocBuilder<A>
fn param(&self, param: &Param) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn variant(&self, variant: &Variant) -> DocBuilder<A>
fn variant(&self, variant: &Variant) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn generic_constraint(
&self,
generic_constraint: &GenericConstraint,
) -> DocBuilder<A>
fn generic_constraint( &self, generic_constraint: &GenericConstraint, ) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn error_node(&self, error_node: &ErrorNode) -> DocBuilder<A>
fn error_node(&self, error_node: &ErrorNode) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn resugared_expr_kind(
&self,
resugared_expr_kind: &ResugaredExprKind,
) -> DocBuilder<A>
fn resugared_expr_kind( &self, resugared_expr_kind: &ResugaredExprKind, ) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn resugared_ty_kind(
&self,
resugared_ty_kind: &ResugaredTyKind,
) -> DocBuilder<A>
fn resugared_ty_kind( &self, resugared_ty_kind: &ResugaredTyKind, ) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn resugared_pat_kind(
&self,
resugared_pat_kind: &ResugaredPatKind,
) -> DocBuilder<A>
fn resugared_pat_kind( &self, resugared_pat_kind: &ResugaredPatKind, ) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn resugared_impl_item_kind(
&self,
resugared_impl_item_kind: &ResugaredImplItemKind,
) -> DocBuilder<A>
fn resugared_impl_item_kind( &self, resugared_impl_item_kind: &ResugaredImplItemKind, ) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn resugared_trait_item_kind(
&self,
resugared_trait_item_kind: &ResugaredTraitItemKind,
) -> DocBuilder<A>
fn resugared_trait_item_kind( &self, resugared_trait_item_kind: &ResugaredTraitItemKind, ) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn resugared_item_kind(
&self,
resugared_item_kind: &ResugaredItemKind,
) -> DocBuilder<A>
fn resugared_item_kind( &self, resugared_item_kind: &ResugaredItemKind, ) -> DocBuilder<A>
👎Deprecated: Do not call this method directly. Use
ToDocument::to_document 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
ToDocument::to_document 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<A, P> PrettyAstExt<A> for P
impl<A, P> PrettyAstExt<A> for P
Source§fn nil(&self) -> DocBuilder<A>
fn nil(&self) -> DocBuilder<A>
Returns an empty document.
Mirrors
pretty::DocAllocator::nil.Source§fn fail(&self) -> DocBuilder<A>
fn fail(&self) -> DocBuilder<A>
Produces a document that fails rendering immediately.
Mirrors
pretty::DocAllocator::fail. Read moreSource§fn hardline(&self) -> DocBuilder<A>
fn hardline(&self) -> DocBuilder<A>
Inserts a mandatory line break.
Mirrors
pretty::DocAllocator::hardline.Source§fn space(&self) -> DocBuilder<A>
fn space(&self) -> DocBuilder<A>
Inserts a single space that disappears when groups flatten.
Mirrors
pretty::DocAllocator::space.Source§fn line(&self) -> DocBuilder<A>
fn line(&self) -> DocBuilder<A>
Acts like a
\n but behaves like space once grouped onto a single line.
Mirrors pretty::DocAllocator::line.Source§fn line_(&self) -> DocBuilder<A>
fn line_(&self) -> DocBuilder<A>
Acts like
line but collapses to nil if grouped on a single line.
Mirrors pretty::DocAllocator::line_.Source§fn softline(&self) -> DocBuilder<A>
fn softline(&self) -> DocBuilder<A>
Acts like
space when the document fits the page, otherwise behaves like line.
Mirrors pretty::DocAllocator::softline.Source§fn softline_(&self) -> DocBuilder<A>
fn softline_(&self) -> DocBuilder<A>
Acts like
nil when the document fits the page, otherwise behaves like line_.
Mirrors pretty::DocAllocator::softline_.Source§fn as_string<U: Display>(&self, data: U) -> DocBuilder<A>
fn as_string<U: Display>(&self, data: U) -> DocBuilder<A>
Source§fn text<'a>(&self, data: impl Into<Cow<'a, str>>) -> DocBuilder<A>
fn text<'a>(&self, data: impl Into<Cow<'a, str>>) -> DocBuilder<A>
Renders the provided text verbatim.
Mirrors
pretty::DocAllocator::text. Read moreSource§fn concat<I>(&self, docs: I) -> DocBuilder<A>
fn concat<I>(&self, docs: I) -> DocBuilder<A>
Concatenates the given values after turning each into a document.
Mirrors
pretty::DocAllocator::concat.Source§fn intersperse<I, S>(&self, docs: I, separator: S) -> DocBuilder<A>where
I::Item: ToDocumentOwned<Self, A>,
I: IntoIterator,
S: ToDocumentOwned<Self, A> + Clone,
A: Clone,
fn intersperse<I, S>(&self, docs: I, separator: S) -> DocBuilder<A>where
I::Item: ToDocumentOwned<Self, A>,
I: IntoIterator,
S: ToDocumentOwned<Self, A> + Clone,
A: Clone,
Concatenates documents while interspersing
separator between every pair.
Mirrors pretty::DocAllocator::intersperse. Read more