Struct markdown_parser::Markdown[][src]

pub struct Markdown { /* fields omitted */ }

Markdown it is a struct refer a true md file

including format,content and front_matter

Implementations

impl Markdown[src]

pub fn content(&self) -> &String[src]

pub fn front_matter(&self) -> &String[src]

pub fn format(&self) -> &Format[src]

impl Markdown[src]

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

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

pub fn set_format(&mut self, val: Format) -> &mut Self[src]

impl Markdown[src]

pub fn new(content: String, front_matter: String, format: Format) -> Self[src]

pub fn write_file<P>(&self, path: P) -> Result<(), Error> where
    P: AsRef<Path>, 
[src]

write data into a file

Examples

use md_parser::*;
Markdown::write_file("to.md").unwrap();

pub fn bytes(&self) -> Vec<u8>[src]

write data into Vec<u8>

pub fn display(&self) -> String[src]

display all data as md format into a String

pub fn adapt<A, T>(self) -> MarkdownResult where
    A: Adapter + Default,
    T: Serialize + DeserializeOwned
[src]

transform a Markdown struct into another format

require two types: Data Object and Adapter

Examples

 use markdown_parser::*;
 use markdown_parser::adapt::{SafeFM, JsonAdapter};
 let origin = read_file("toml.md").unwrap();
 let md = origin.adapt::<JsonAdapter, SafeFM>().unwrap();

Trait Implementations

impl Clone for Markdown[src]

impl Debug for Markdown[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> 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.