Struct somedoc::model::document::Document [−][src]
pub struct Document { /* fields omitted */ }
Expand description
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]
impl Document
[src]pub fn has_metadata(&self) -> bool
[src]
pub fn has_metadata(&self) -> bool
[src]Returns true
if this document has any associated metadata, else false
.
pub fn add_metadata(&mut self, datum: Metadata) -> &mut Self
[src]
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]
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]
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]
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]
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.
pub fn add_copyright(&mut self, v: Copyright) -> &mut Self
[src]
pub fn add_copyright(&mut self, v: Copyright) -> &mut Self
[src]Add a copyright (metadata value) to this document.
pub fn add_copyright_str(
&mut self,
year: u16,
organization: Option<&str>,
comment: Option<&str>
) -> &mut Self
[src]
pub fn add_copyright_str(
&mut self,
year: u16,
organization: Option<&str>,
comment: Option<&str>
) -> &mut Self
[src]Add a copyright (metadata value) to this document.
pub fn add_keywords(&mut self, v: &[String]) -> &mut Self
[src]
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]
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]
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]
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]
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]
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]
pub fn abstract_block(&self) -> &Option<Paragraph>
[src]Return the Paragraph
, if present, acting as the abstract to this document.
Trait Implementations
impl<'de> Deserialize<'de> for Document
[src]
impl<'de> Deserialize<'de> for Document
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
impl HasBlockContent for Document
[src]
impl HasBlockContent for Document
[src]fn from(inner: BlockContent) -> Self
[src]
fn from(inner: BlockContent) -> Self
[src]Create a new block content container from the provided content item.
fn comment(inner: String) -> Self
[src]
fn comment(inner: String) -> Self
[src]Create a new block content container from the provided String
content item.
fn front_matter(matter: FrontMatter) -> Self
[src]
fn front_matter(matter: FrontMatter) -> Self
[src]Create a new block content container from the provided FrontMatter
content item.
fn heading(inner: Heading) -> Self
[src]
fn heading(inner: Heading) -> Self
[src]Create a new block content container from the provided Heading
content item.
fn image(inner: ImageBlock) -> Self
[src]
fn image(inner: ImageBlock) -> Self
[src]Create a new block content container from the provided ImageBlock
content item.
fn math(inner: MathBlock) -> Self
[src]
fn math(inner: MathBlock) -> Self
[src]Create a new block content container from the provided MathBlock
content item.
fn list(inner: List) -> Self
[src]
fn list(inner: List) -> Self
[src]Create a new block content container from the provided List
content item.
fn definition_list(inner: DefinitionList) -> Self
[src]
fn definition_list(inner: DefinitionList) -> Self
[src]Create a new block content container from the provided DefinitionList
content item.
fn formatted(inner: Formatted) -> Self
[src]
fn formatted(inner: Formatted) -> Self
[src]Create a new block content container from the provided Formatted
content item.
fn code_block(inner: CodeBlock) -> Self
[src]
fn code_block(inner: CodeBlock) -> Self
[src]Create a new block content container from the provided CodeBlock
content item.
fn paragraph(inner: Paragraph) -> Self
[src]
fn paragraph(inner: Paragraph) -> Self
[src]Create a new block content container from the provided Paragraph
content item.
fn block_quote(inner: Quote) -> Self
[src]
fn block_quote(inner: Quote) -> Self
[src]Create a new block content container from the provided Quote
content item.
fn table(inner: Table) -> Self
[src]
fn table(inner: Table) -> Self
[src]Create a new block content container from the provided Table
content item.
fn thematic_break() -> Self
[src]
fn thematic_break() -> Self
[src]Create a new block content container with a thematic break.
fn add_comment_str(&mut self, inner: &str) -> &mut Self
[src]
fn add_comment_str(&mut self, inner: &str) -> &mut Self
[src]Add the provided Comment
to this container’s inner content.
fn add_front_matter(&mut self, matter: FrontMatter) -> &mut Self
[src]
fn add_front_matter(&mut self, matter: FrontMatter) -> &mut Self
[src]Add the provided FrontMatter
to this container’s inner content.
fn add_heading(&mut self, inner: Heading) -> &mut Self
[src]
fn add_heading(&mut self, inner: Heading) -> &mut Self
[src]Add the provided Heading
to this container’s inner content.
fn add_image(&mut self, inner: ImageBlock) -> &mut Self
[src]
fn add_image(&mut self, inner: ImageBlock) -> &mut Self
[src]Add the provided ImageBlock
to this container’s inner content.
fn add_math(&mut self, inner: MathBlock) -> &mut Self
[src]
fn add_math(&mut self, inner: MathBlock) -> &mut Self
[src]Add the provided MathBlock
to this container’s inner content.
fn add_list(&mut self, inner: List) -> &mut Self
[src]
fn add_list(&mut self, inner: List) -> &mut Self
[src]Add the provided List
to this container’s inner content.
fn add_definition_list(&mut self, inner: DefinitionList) -> &mut Self
[src]
fn add_definition_list(&mut self, inner: DefinitionList) -> &mut Self
[src]Add the provided DefinitionList
to this container’s inner content.
fn add_formatted(&mut self, inner: Formatted) -> &mut Self
[src]
fn add_formatted(&mut self, inner: Formatted) -> &mut Self
[src]Add the provided Formatted
to this container’s inner content.
fn add_code_block(&mut self, inner: CodeBlock) -> &mut Self
[src]
fn add_code_block(&mut self, inner: CodeBlock) -> &mut Self
[src]Add the provided CodeBlock
to this container’s inner content.
fn add_paragraph(&mut self, inner: Paragraph) -> &mut Self
[src]
fn add_paragraph(&mut self, inner: Paragraph) -> &mut Self
[src]Add the provided Paragraph
to this container’s inner content.
fn add_block_quote(&mut self, inner: Quote) -> &mut Self
[src]
fn add_block_quote(&mut self, inner: Quote) -> &mut Self
[src]Add the provided Quote
to this container’s inner content.
fn add_table(&mut self, inner: Table) -> &mut Self
[src]
fn add_table(&mut self, inner: Table) -> &mut Self
[src]Add the provided Table
to this container’s inner content.
fn add_thematic_break(&mut self) -> &mut Self
[src]
fn add_thematic_break(&mut self) -> &mut Self
[src]Add a ThematicBreak
to this container’s inner content.
impl HasInnerContent<BlockContent> for Document
[src]
impl HasInnerContent<BlockContent> for Document
[src]fn inner(&self) -> &Vec<BlockContent>
[src]
fn inner(&self) -> &Vec<BlockContent>
[src]Return a reference to the inner value. Read more
fn into_inner(self) -> Vec<BlockContent>
[src]
fn into_inner(self) -> Vec<BlockContent>
[src]Return the inner value, consuming self
. Read more
fn inner_mut(&mut self) -> &mut Vec<BlockContent>
[src]
fn inner_mut(&mut self) -> &mut Vec<BlockContent>
[src]Return a mutable reference to the inner list of content. Read more
fn add_content(&mut self, content: BlockContent) -> Result<()>
[src]
fn add_content(&mut self, content: BlockContent) -> Result<()>
[src]Add content
to the inner list of content. If there is some consistency condition that
would be broken by this addition an error will be returned. Read more
Auto Trait Implementations
impl RefUnwindSafe for Document
impl Send for Document
impl Sync for Document
impl Unpin for Document
impl UnwindSafe for Document
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,