pub struct LeanPrinter { /* private fields */ }Expand description
The Lean printer
Implementations§
Source§impl LeanPrinter
impl LeanPrinter
Sourcepub fn is_hax_core_models_extraction_mode(&self) -> bool
pub fn is_hax_core_models_extraction_mode(&self) -> bool
Checks if we are extracting core models to be able to use different namespeacing when referring to core.
Sourcepub fn render_id(&self, id: &GlobalId) -> String
pub fn render_id(&self, id: &GlobalId) -> String
Render a global id using the Rendering strategy of the Lean printer. Works for both concrete and projector ids. TODO: https://github.com/cryspen/hax/issues/1660
Sourcepub fn render_last(&self, id: &GlobalId) -> String
pub fn render_last(&self, id: &GlobalId) -> String
Renders the last, most local part of an id. Used for named arguments of constructors.
Sourcepub fn render_with_injection(&self, id: &GlobalId, injection: &String) -> String
pub fn render_with_injection(&self, id: &GlobalId, injection: &String) -> String
Inject an identifier in before-last position while rendering
TODO: use DefIdInner::kind for this instead (https://github.com/cryspen/hax/issues/1877)
Source§impl LeanPrinter
impl LeanPrinter
Sourcepub fn arguments<A: 'static + Clone, D>(
&self,
fields: &[(GlobalId, D)],
is_record: &bool,
) -> DocBuilder<A>where
D: ToDocument<Self, A>,
pub fn arguments<A: 'static + Clone, D>(
&self,
fields: &[(GlobalId, D)],
is_record: &bool,
) -> DocBuilder<A>where
D: ToDocument<Self, A>,
Prints arguments a variant or constructor of struct, using named or unamed arguments based
on the is_record flag. Used for both expressions and patterns
Trait Implementations§
Source§impl Clone for LeanPrinter
impl Clone for LeanPrinter
Source§fn clone(&self) -> LeanPrinter
fn clone(&self) -> LeanPrinter
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for LeanPrinter
impl Default for LeanPrinter
Source§fn default() -> LeanPrinter
fn default() -> LeanPrinter
Source§impl HasContextualSpan for LeanPrinter
impl HasContextualSpan for LeanPrinter
Source§impl HasLinkedItemGraph for LeanPrinter
impl HasLinkedItemGraph for LeanPrinter
Source§fn linked_item_graph(&self) -> &LinkedItemGraph
fn linked_item_graph(&self) -> &LinkedItemGraph
LinkedItemGraph.Source§fn with_linked_item_graph(self, graph: Rc<LinkedItemGraph>) -> Self
fn with_linked_item_graph(self, graph: Rc<LinkedItemGraph>) -> Self
LinkedItemGraph.Source§impl<A: 'static + Clone> PrettyAst<A> for LeanPrinter
impl<A: 'static + Clone> PrettyAst<A> for LeanPrinter
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§const NAME: &'static str = "Lean"
const NAME: &'static str = "Lean"
PrettyAst.
Useful for diagnostics and debugging.Source§fn module(&self, module: &Module) -> DocBuilder<A>
fn module(&self, module: &Module) -> DocBuilder<A>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn global_id(&self, global_id: &GlobalId) -> DocBuilder<A>
fn global_id(&self, global_id: &GlobalId) -> DocBuilder<A>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
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>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn generic_constraint(&self, _: &GenericConstraint) -> DocBuilder<A>
fn generic_constraint(&self, _: &GenericConstraint) -> DocBuilder<A>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
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>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
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>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn expr(&self, _: &Expr) -> DocBuilder<A>
fn expr(&self, _: &Expr) -> DocBuilder<A>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
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>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
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>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
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>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
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>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
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>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
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>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
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>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
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>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
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>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
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>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
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>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
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>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
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>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn impl_item(&self, _: &ImplItem) -> DocBuilder<A>
fn impl_item(&self, _: &ImplItem) -> DocBuilder<A>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn impl_ident(&self, _: &ImplIdent) -> DocBuilder<A>
fn impl_ident(&self, _: &ImplIdent) -> DocBuilder<A>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn trait_goal(&self, _: &TraitGoal) -> DocBuilder<A>
fn trait_goal(&self, _: &TraitGoal) -> DocBuilder<A>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn variant(&self, _: &Variant) -> DocBuilder<A>
fn variant(&self, _: &Variant) -> DocBuilder<A>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
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>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn metadata(&self, _: &Metadata) -> DocBuilder<A>
fn metadata(&self, _: &Metadata) -> DocBuilder<A>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
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>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
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>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
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>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
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>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
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>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn attribute(&self, _: &Attribute) -> DocBuilder<A>
fn attribute(&self, _: &Attribute) -> DocBuilder<A>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
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>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
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>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
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>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
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>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
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>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§fn emit_diagnostic(&self, kind: Kind)
fn emit_diagnostic(&self, kind: Kind)
Source§fn unimplemented_method(
&self,
method: &str,
ast: FragmentRef<'_>,
) -> DocBuilder<A>
fn unimplemented_method( &self, method: &str, ast: FragmentRef<'_>, ) -> DocBuilder<A>
Source§fn trait_item(&self, trait_item: &TraitItem) -> DocBuilder<A>
fn trait_item(&self, trait_item: &TraitItem) -> DocBuilder<A>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
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>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
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>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
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>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
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>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
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>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
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>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
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>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
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>
Do not call this method directly. Use ToDocument::to_document instead, so annotations/spans are preserved correctly.
ToDocument::to_document instead, so annotations/spans are preserved correctly.Source§impl RenderView for LeanPrinter
impl RenderView for LeanPrinter
Source§fn reserved_keywords() -> &'static HashSet<String>
fn reserved_keywords() -> &'static HashSet<String>
Source§fn should_escape(id: &str) -> bool
fn should_escape(id: &str) -> bool
Source§fn separator(&self) -> &str
fn separator(&self) -> &str
"::"). Read moreSource§fn relativize_module_path<'a>(
&self,
module_path: &'a [PathSegment],
) -> &'a [PathSegment]
fn relativize_module_path<'a>( &self, module_path: &'a [PathSegment], ) -> &'a [PathSegment]
Source§fn render_path_segment(&self, chunk: &PathSegment) -> Vec<String>
fn render_path_segment(&self, chunk: &PathSegment) -> Vec<String>
PathSegment into a vector of display atoms. Read moreSource§fn is_reserved_keyword(id: &str) -> bool
fn is_reserved_keyword(id: &str) -> bool
Source§fn escape(id: &str) -> String
fn escape(id: &str) -> String
Self::should_escapeSource§fn render_unnamed_path_segment_payload(
&self,
unnamed: UnnamedPathSegmentPayload,
) -> Symbol
fn render_unnamed_path_segment_payload( &self, unnamed: UnnamedPathSegmentPayload, ) -> Symbol
Source§fn render_path_segment_payload(&self, payload: PathSegmentPayload) -> Symbol
fn render_path_segment_payload(&self, payload: PathSegmentPayload) -> Symbol
Source§fn render_suffix(&self, suffix: &ReservedSuffix) -> String
fn render_suffix(&self, suffix: &ReservedSuffix) -> String
Source§fn rendered_to_strings(
&self,
rendered: Rendered,
) -> impl Iterator<Item = String>
fn rendered_to_strings( &self, rendered: Rendered, ) -> impl Iterator<Item = String>
Source§fn rendered_to_string(&self, rendered: Rendered) -> String
fn rendered_to_string(&self, rendered: Rendered) -> String
Source§impl<A: 'static + Clone> ToDocument<LeanPrinter, A> for Vec<Param>
Render parameters, adding a line after each parameter
impl<A: 'static + Clone> ToDocument<LeanPrinter, A> for Vec<Param>
Render parameters, adding a line after each parameter
Source§fn to_document(&self, printer: &LeanPrinter) -> DocBuilder<A>
fn to_document(&self, printer: &LeanPrinter) -> DocBuilder<A>
Source§impl<A: 'static + Clone> ToDocument<LeanPrinter, A> for (Vec<GenericParam>, &TraitItem)
impl<A: 'static + Clone> ToDocument<LeanPrinter, A> for (Vec<GenericParam>, &TraitItem)
Source§fn to_document(&self, printer: &LeanPrinter) -> DocBuilder<A>
fn to_document(&self, printer: &LeanPrinter) -> DocBuilder<A>
Auto Trait Implementations§
impl !Send for LeanPrinter
impl !Sync for LeanPrinter
impl Freeze for LeanPrinter
impl RefUnwindSafe for LeanPrinter
impl Unpin for LeanPrinter
impl UnsafeUnpin for LeanPrinter
impl UnwindSafe for LeanPrinter
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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>
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>
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 moreimpl<T> IsBody for Twhere
T: Clone + 'static,
Source§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>
pretty::DocAllocator::nil.Source§fn fail(&self) -> DocBuilder<A>
fn fail(&self) -> DocBuilder<A>
pretty::DocAllocator::fail. Read moreSource§fn hardline(&self) -> DocBuilder<A>
fn hardline(&self) -> DocBuilder<A>
pretty::DocAllocator::hardline.Source§fn space(&self) -> DocBuilder<A>
fn space(&self) -> DocBuilder<A>
pretty::DocAllocator::space.Source§fn line(&self) -> DocBuilder<A>
fn line(&self) -> DocBuilder<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>
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>
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>
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>
pretty::DocAllocator::text. Read moreSource§fn concat<I>(&self, docs: I) -> DocBuilder<A>
fn concat<I>(&self, docs: I) -> DocBuilder<A>
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,
separator between every pair.
Mirrors pretty::DocAllocator::intersperse. Read more