pub struct Builder<A: Allocator> { /* private fields */ }
Expand description
Document builder.
Implementations§
source§impl<'a, A: Allocator + Clone + 'a> Builder<A>
impl<'a, A: Allocator + Clone + 'a> Builder<A>
sourcepub fn break(&self, value: impl Into<Document<'a>>) -> Document<'a>
pub fn break(&self, value: impl Into<Document<'a>>) -> Document<'a>
Breaks a document into multiple lines.
sourcepub fn indent(&self, value: impl Into<Document<'a>>) -> Document<'a>
pub fn indent(&self, value: impl Into<Document<'a>>) -> Document<'a>
Indents a document by a level.
sourcepub fn offside(
&self,
value: impl Into<Document<'a>>,
soft: bool
) -> Document<'a>
pub fn offside( &self, value: impl Into<Document<'a>>, soft: bool ) -> Document<'a>
Creates a document indented to a current column.
sourcepub fn sequence(
&self,
values: impl IntoIterator<Item = impl Into<Document<'a>>>
) -> Document<'a>
pub fn sequence( &self, values: impl IntoIterator<Item = impl Into<Document<'a>>> ) -> Document<'a>
Creates a sequence of documents.
sourcepub fn strings<'b>(
&self,
values: impl IntoIterator<Item = &'b str>
) -> Document<'a>
pub fn strings<'b>( &self, values: impl IntoIterator<Item = &'b str> ) -> Document<'a>
Creates a concatenation of strings.
sourcepub fn line_suffixes<'b>(
&self,
values: impl IntoIterator<Item = &'b str>
) -> Document<'a>
pub fn line_suffixes<'b>( &self, values: impl IntoIterator<Item = &'b str> ) -> Document<'a>
Creates a set of line suffixes.
sourcepub fn allocate_slice<T>(&self, values: impl IntoIterator<Item = T>) -> &'a [T]
pub fn allocate_slice<T>(&self, values: impl IntoIterator<Item = T>) -> &'a [T]
Allocates a slice.
sourcepub fn allocate_str<'b>(
&self,
values: impl IntoIterator<Item = &'b str>
) -> &'a str
pub fn allocate_str<'b>( &self, values: impl IntoIterator<Item = &'b str> ) -> &'a str
Allocates a string.
Trait Implementations§
Auto Trait Implementations§
impl<A> RefUnwindSafe for Builder<A>where
A: RefUnwindSafe,
impl<A> Send for Builder<A>where
A: Send,
impl<A> Sync for Builder<A>where
A: Sync,
impl<A> Unpin for Builder<A>where
A: Unpin,
impl<A> UnwindSafe for Builder<A>where
A: UnwindSafe,
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