Struct somedoc::model::document::Document[][src]

pub struct Document { /* fields omitted */ }

The root document itself, this contains a list of BlockContent values as well as a list of metadata properties.

Note that the add_ and set_ methods all return &mut Self and so calls to these may be chained.

Implementations

impl Document[src]

pub fn has_metadata(&self) -> bool[src]

Returns true if this document has any associated metadata, else false.

pub fn metadata(&self) -> &Vec<Metadata>[src]

Return the list of associated metadata.

pub fn add_metadata(&mut self, datum: Metadata) -> &mut Self[src]

Add a metadata item to this document.

pub fn set_title(&mut self, v: &str) -> &mut Self[src]

Set the title (metadata value) of this document.

pub fn set_date(&mut self, v: &str) -> &mut Self[src]

Set the date (metadata value) of this document.

pub fn add_author(&mut self, v: Author) -> &mut Self[src]

Add an author (metadata value) to this document.

pub fn add_author_str(
    &mut self,
    name: &str,
    email: Option<&str>,
    organization: Option<&str>
) -> &mut Self
[src]

Add an author (metadata value) to this document.

Add a copyright (metadata value) to this document.

Add a copyright (metadata value) to this document.

pub fn add_keywords(&mut self, v: &[String]) -> &mut Self[src]

Add a list of keywords (metadata value) to this document.

pub fn add_keywords_str(&mut self, v: &[&str]) -> &mut Self[src]

Add a list of keywords (metadata value) to this document.

pub fn add_metadata_property(&mut self, v: SimpleProperty) -> &mut Self[src]

Add an arbitrary, named, metadata value)to this document.

pub fn add_metadata_property_str(
    &mut self,
    name: &str,
    value: &str
) -> &mut Self
[src]

Add an arbitrary, named, metadata value)to this document.

pub fn has_abstract(&self) -> bool[src]

Returns true if an abstract has been added to this document, else false.

pub fn add_abstract(&mut self, abstract_block: Paragraph) -> &mut Self[src]

Add a Paragraph acting as the abstract to this document.

pub fn abstract_block(&self) -> &Option<Paragraph>[src]

Return the Paragraph, if present, acting as the abstract to this document.

Trait Implementations

impl Clone for Document[src]

impl Debug for Document[src]

impl Default for Document[src]

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

impl HasBlockContent for Document[src]

impl HasInnerContent<BlockContent> for Document[src]

impl Into<Document> for BlockContent[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, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.