Struct somedoc::model::document::Document [−][src]
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]
&mut self,
name: &str,
email: Option<&str>,
organization: Option<&str>
) -> &mut Self
Add an author (metadata value) to this document.
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]
&mut self,
year: u16,
organization: Option<&str>,
comment: Option<&str>
) -> &mut Self
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]
&mut self,
name: &str,
value: &str
) -> &mut Self
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]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl HasBlockContent for Document
[src]
fn from(inner: BlockContent) -> Self
[src]
fn comment(inner: String) -> Self
[src]
fn front_matter(matter: FrontMatter) -> Self
[src]
fn heading(inner: Heading) -> Self
[src]
fn image(inner: ImageBlock) -> Self
[src]
fn math(inner: MathBlock) -> Self
[src]
fn list(inner: List) -> Self
[src]
fn definition_list(inner: DefinitionList) -> Self
[src]
fn formatted(inner: Formatted) -> Self
[src]
fn code_block(inner: CodeBlock) -> Self
[src]
fn paragraph(inner: Paragraph) -> Self
[src]
fn block_quote(inner: Quote) -> Self
[src]
fn table(inner: Table) -> Self
[src]
fn thematic_break() -> Self
[src]
fn add_comment_str(&mut self, inner: &str) -> &mut Self
[src]
fn add_front_matter(&mut self, matter: FrontMatter) -> &mut Self
[src]
fn add_heading(&mut self, inner: Heading) -> &mut Self
[src]
fn add_image(&mut self, inner: ImageBlock) -> &mut Self
[src]
fn add_math(&mut self, inner: MathBlock) -> &mut Self
[src]
fn add_list(&mut self, inner: List) -> &mut Self
[src]
fn add_definition_list(&mut self, inner: DefinitionList) -> &mut Self
[src]
fn add_formatted(&mut self, inner: Formatted) -> &mut Self
[src]
fn add_code_block(&mut self, inner: CodeBlock) -> &mut Self
[src]
fn add_paragraph(&mut self, inner: Paragraph) -> &mut Self
[src]
fn add_block_quote(&mut self, inner: Quote) -> &mut Self
[src]
fn add_table(&mut self, inner: Table) -> &mut Self
[src]
fn add_thematic_break(&mut self) -> &mut Self
[src]
impl HasInnerContent<BlockContent> for Document
[src]
fn inner(&self) -> &Vec<BlockContent>
[src]
fn into_inner(self) -> Vec<BlockContent>
[src]
fn inner_mut(&mut self) -> &mut Vec<BlockContent>
[src]
fn add_content(&mut self, content: BlockContent) -> Result<()>
[src]
fn has_inner(&self) -> bool
[src]
impl Into<Document> for BlockContent
[src]
impl Serialize for Document
[src]
Auto Trait Implementations
impl RefUnwindSafe for Document
[src]
impl Send for Document
[src]
impl Sync for Document
[src]
impl Unpin for Document
[src]
impl UnwindSafe for Document
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,