pub struct Body {
pub text: String,
pub path: PathBuf,
}Expand description
A document’s prose body, and the file it was read from.
The two halves travel together because a separated document keeps them in
different files: the text comes from the content target while the metadata
stays in the node, so a caller that renders the prose needs to know which
path declares its grammar. For a combined document path is
simply the document’s own.
Fields§
§text: StringThe prose itself. Empty for a document that has none — a config document standing for itself, or a manifest node standing for a directory.
path: PathBufThe file the prose lives in: the document’s own path when combined, its
content_path when separated. What
ContentFormat::from_extension
should be asked about.
Trait Implementations§
impl Eq for Body
impl StructuralPartialEq for Body
Auto Trait Implementations§
impl Freeze for Body
impl RefUnwindSafe for Body
impl Send for Body
impl Sync for Body
impl Unpin for Body
impl UnsafeUnpin for Body
impl UnwindSafe for Body
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.