pub(crate) struct Document {
dialect: Dialect,
pub(super) value: Value,
trailing: Trivia,
indent: Indent,
}Expand description
The root of a parsed or built document.
Fields§
§dialect: Dialect§value: Value§trailing: Trivia§indent: IndentOne level of indentation, for members inserted into the document.
Implementations§
Source§impl Document
impl Document
Sourcepub(super) fn parsed(dialect: Dialect, value: Value, trailing: Trivia) -> Self
pub(super) fn parsed(dialect: Dialect, value: Value, trailing: Trivia) -> Self
A parsed document. Its indent is the unit of its first multi-line member, or two spaces.
Sourcepub(super) fn end_with_newline(&mut self)
pub(super) fn end_with_newline(&mut self)
End the document with exactly one line break.
Trait Implementations§
Source§impl Editable for Document
impl Editable for Document
type Node = Value
Source§fn header_text(&self) -> &str
fn header_text(&self) -> &str
The text of the header comment of this document.
Source§fn leading(&self) -> (&str, &str)
fn leading(&self) -> (&str, &str)
The text before the first entry as the document root holds it and as
the first entry holds it. A format that keeps all of it in one place
returns an empty root text.
Source§fn set_leading(&mut self, applied: Applied<'_>)
fn set_leading(&mut self, applied: Applied<'_>)
Put the leading text of an applied header in place.
Source§fn apply_header(&mut self, desired: &Self, existing: Existing)
fn apply_header(&mut self, desired: &Self, existing: Existing)
Replace the leading comment block of this document with the header
of
desired.Auto Trait Implementations§
impl Freeze for Document
impl RefUnwindSafe for Document
impl Send for Document
impl Sync for Document
impl Unpin for Document
impl UnsafeUnpin for Document
impl UnwindSafe for Document
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