pub struct DocumentValidationService;
Expand description
Service for validating documents and detecting their types
Implementations§
Source§impl DocumentValidationService
impl DocumentValidationService
Sourcepub async fn validate_document<P: AsRef<Path>>(
&self,
file_path: P,
) -> Result<ValidationResult>
pub async fn validate_document<P: AsRef<Path>>( &self, file_path: P, ) -> Result<ValidationResult>
Validate a document file and detect its type
Sourcepub async fn detect_document_type<P: AsRef<Path>>(
&self,
file_path: P,
) -> Result<DocumentType>
pub async fn detect_document_type<P: AsRef<Path>>( &self, file_path: P, ) -> Result<DocumentType>
Validate a document and return just the document type (simpler interface)
Sourcepub async fn validate_document_as_type<P: AsRef<Path>>(
&self,
file_path: P,
expected_type: DocumentType,
) -> Result<bool>
pub async fn validate_document_as_type<P: AsRef<Path>>( &self, file_path: P, expected_type: DocumentType, ) -> Result<bool>
Validate a document of a specific expected type
Sourcepub async fn is_valid_document<P: AsRef<Path>>(&self, file_path: P) -> bool
pub async fn is_valid_document<P: AsRef<Path>>(&self, file_path: P) -> bool
Check if a document is valid without loading the full document
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DocumentValidationService
impl RefUnwindSafe for DocumentValidationService
impl Send for DocumentValidationService
impl Sync for DocumentValidationService
impl Unpin for DocumentValidationService
impl UnwindSafe for DocumentValidationService
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