[][src]Struct takeoff::document::Document

#[non_exhaustive]pub struct Document {
    pub content: String,
    pub metadata: Metadata,
    pub source_path: PathBuf,
}

A Document describes a Markdown file found in a Launchpad's source directory.

Fields (Non-exhaustive)

Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
content: String

The content of the Markdown file without the <!-- Metadata --> block if it was present.

metadata: Metadata

The parsed metadata.

source_path: PathBuf

The absolute path of the source Markdown file.

Implementations

impl Document[src]

pub fn new(path: PathBuf) -> Result<Self>[src]

Creates a new Document from a file. If parsing Metadata fails for this document, then an error is printed and Metadata::default() will be used instead.

pub fn create_destination(&self, launchpad: &Launchpad) -> Result<PathBuf>[src]

Creates all the directories required and returns the HTML path where this Document should be written to.

Trait Implementations

impl Debug for Document[src]

impl<'de> Deserialize<'de> for Document[src]

impl Serialize for Document[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,