struct Writer<'a, 'f> {
out: &'a mut Formatter<'f>,
indent: usize,
}Fields§
§out: &'a mut Formatter<'f>§indent: usizeImplementations§
Source§impl Writer<'_, '_>
impl Writer<'_, '_>
fn line(&mut self, text: &str) -> Result
fn pad(&mut self) -> Result
fn nested(&mut self, write: impl FnOnce(&mut Self) -> Result) -> Result
fn comment(&mut self, node: &Annotated) -> Result
Sourcefn mapping(&mut self, entries: &Entries, lead: Lead) -> Result
fn mapping(&mut self, entries: &Entries, lead: Lead) -> Result
Write the entries at the current indent. The lead tells whether the
caller has already written the indent of the first entry.
Sourcefn sequence(&mut self, items: &[Annotated], lead: Lead) -> Result
fn sequence(&mut self, items: &[Annotated], lead: Lead) -> Result
Write the items at the current indent. The lead tells whether the
caller has already written the indent of the first item.
Sourcefn after_marker(&mut self, node: &Annotated, marker: Marker) -> Result
fn after_marker(&mut self, node: &Annotated, marker: Marker) -> Result
Write what follows a key: or - marker and end the line.
A container under a dash starts on the dash line unless its first child has a comment. Under a key it starts on the next line.
Sourcefn lead(marker: Marker, first: Option<&Annotated>) -> Lead
fn lead(marker: Marker, first: Option<&Annotated>) -> Lead
Whether a container starts on the line of its marker.
fn block( &mut self, lead: Lead, write: impl FnOnce(&mut Self, Lead) -> Result, ) -> Result
fn literal(&mut self, block: &LiteralBlock<'_>) -> Result
Auto Trait Implementations§
impl<'a, 'f> !RefUnwindSafe for Writer<'a, 'f>
impl<'a, 'f> !Send for Writer<'a, 'f>
impl<'a, 'f> !Sync for Writer<'a, 'f>
impl<'a, 'f> !UnwindSafe for Writer<'a, 'f>
impl<'a, 'f> Freeze for Writer<'a, 'f>
impl<'a, 'f> Unpin for Writer<'a, 'f>
impl<'a, 'f> UnsafeUnpin for Writer<'a, 'f>
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