pub struct DocumentFactory;
Expand description
Factory for creating documents from files Determines document type from frontmatter and creates appropriate document instance
Implementations§
Source§impl DocumentFactory
impl DocumentFactory
Sourcepub async fn from_file<P: AsRef<Path>>(
path: P,
) -> Result<Box<dyn Document>, DocumentValidationError>
pub async fn from_file<P: AsRef<Path>>( path: P, ) -> Result<Box<dyn Document>, DocumentValidationError>
Create a document from a file path Reads the file, determines type from frontmatter, then creates the appropriate document
Sourcepub fn from_content(
raw_content: &str,
_filepath: &str,
) -> Result<Box<dyn Document>, DocumentValidationError>
pub fn from_content( raw_content: &str, _filepath: &str, ) -> Result<Box<dyn Document>, DocumentValidationError>
Create a document from raw content string
Auto Trait Implementations§
impl Freeze for DocumentFactory
impl RefUnwindSafe for DocumentFactory
impl Send for DocumentFactory
impl Sync for DocumentFactory
impl Unpin for DocumentFactory
impl UnwindSafe for DocumentFactory
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
Convert
self
to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
Convert
&self
to an expression for Diesel’s query builder. Read more