Struct markdown_parser::Markdown [−][src]
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]
P: AsRef<Path>,
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]
A: Adapter + Default,
T: Serialize + DeserializeOwned,
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
Auto Trait Implementations
impl RefUnwindSafe for Markdown
impl Send for Markdown
impl Sync for Markdown
impl Unpin for Markdown
impl UnwindSafe for Markdown
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> 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>,