pub struct Doctree {
pub root: Node,
pub sources: Vec<String>,
}Expand description
One parsed document. root.kind == kinds::DOCUMENT.
Fields§
§root: Node§sources: Vec<String>The source table Span.source indexes: one path per source the
parse consumed. Entry 0 is the document’s own path; sub-parses over
lifted text (table cells) and, later, included files push further
entries. #[serde(default = "default_sources")] is the standard
hedge for a field added after data in this shape might already
exist — but note it only rescues self-describing formats (e.g.
JSON) from a missing field: bincode’s wire format has no
field-presence framing, so a bincode blob that predates this field
would still fail to decode (UnexpectedEnd) rather than fall back
to the default. No such blob existed before the field did, so that
gap isn’t live today.
Implementations§
Source§impl Doctree
impl Doctree
Sourcepub fn source_and_line(&self, span: Span) -> (&str, u32)
pub fn source_and_line(&self, span: Span) -> (&str, u32)
The (source path, line) a warning about a node should report —
docutils’ (node.source, node.line). Line 0 means unknown; a
source the table doesn’t know (a foreign or hand-built span)
falls back to the document’s own path.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Doctree
impl<'de> Deserialize<'de> for Doctree
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl StructuralPartialEq for Doctree
Auto Trait Implementations§
impl Freeze for Doctree
impl RefUnwindSafe for Doctree
impl Send for Doctree
impl Sync for Doctree
impl Unpin for Doctree
impl UnsafeUnpin for Doctree
impl UnwindSafe for Doctree
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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 more