pub trait Chunker: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn content_types(&self) -> &[&str];
fn can_chunk(&self, content_type: &ContentType) -> bool;
fn chunk<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
content: &'life1 ExtractedContent,
config: &'life2 ChunkConfig,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChunkOutput>, ChunkError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Expand description
Trait for splitting content into chunks.
Required Methods§
Sourcefn content_types(&self) -> &[&str]
fn content_types(&self) -> &[&str]
Content types this chunker is designed for.
Sourcefn can_chunk(&self, content_type: &ContentType) -> bool
fn can_chunk(&self, content_type: &ContentType) -> bool
Check if this chunker can handle the given content type.
Sourcefn chunk<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
content: &'life1 ExtractedContent,
config: &'life2 ChunkConfig,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChunkOutput>, ChunkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn chunk<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
content: &'life1 ExtractedContent,
config: &'life2 ChunkConfig,
) -> Pin<Box<dyn Future<Output = Result<Vec<ChunkOutput>, ChunkError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Chunk the extracted content.