pub struct DocBuffer { /* private fields */ }Expand description
A growable sink of Doc elements, the target of the doc_write! macro and of Format
implementors.
Implementations§
Source§impl DocBuffer
impl DocBuffer
Sourcepub fn write_element(&mut self, doc: Doc)
pub fn write_element(&mut self, doc: Doc)
Append one already-built Doc element in order.
Sourcepub fn write_fmt_value<T: Format + ?Sized>(&mut self, value: &T)
pub fn write_fmt_value<T: Format + ?Sized>(&mut self, value: &T)
Append a value by letting it format itself into this buffer.
Sourcepub fn write_with_rule<T: ?Sized, R: FormatRule<T>>(
&mut self,
rule: &R,
item: &T,
)
pub fn write_with_rule<T: ?Sized, R: FormatRule<T>>( &mut self, rule: &R, item: &T, )
Append a value formatted by an external FormatRule.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DocBuffer
impl RefUnwindSafe for DocBuffer
impl Send for DocBuffer
impl Sync for DocBuffer
impl Unpin for DocBuffer
impl UnsafeUnpin for DocBuffer
impl UnwindSafe for DocBuffer
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