pub struct TextExtractor;Expand description
Extractor for plain text files.
Implementations§
Source§impl TextExtractor
impl TextExtractor
Trait Implementations§
Source§impl ContentExtractor for TextExtractor
impl ContentExtractor for TextExtractor
Source§fn supported_types(&self) -> &[&str]
fn supported_types(&self) -> &[&str]
Returns the MIME types this extractor can handle.
Source§fn can_extract_by_extension(&self, path: &Path) -> bool
fn can_extract_by_extension(&self, path: &Path) -> bool
Check if extractor can handle based on file extension.
Source§fn extract<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<ExtractedContent, ExtractError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn extract<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = Result<ExtractedContent, ExtractError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Extract content from a file.
Source§fn can_extract(&self, path: &Path, mime_type: &str) -> bool
fn can_extract(&self, path: &Path, mime_type: &str) -> bool
Check if this extractor can handle the given file.
Source§fn extract_bytes<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_data: &'life1 [u8],
_mime_type: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<ExtractedContent, ExtractError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn extract_bytes<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_data: &'life1 [u8],
_mime_type: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<ExtractedContent, ExtractError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Extract content from bytes (for embedded content).
Auto Trait Implementations§
impl Freeze for TextExtractor
impl RefUnwindSafe for TextExtractor
impl Send for TextExtractor
impl Sync for TextExtractor
impl Unpin for TextExtractor
impl UnwindSafe for TextExtractor
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().