Chunker

Trait Chunker 

Source
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§

Source

fn name(&self) -> &str

Name of this chunking strategy.

Source

fn content_types(&self) -> &[&str]

Content types this chunker is designed for.

Source

fn can_chunk(&self, content_type: &ContentType) -> bool

Check if this chunker can handle the given content type.

Source

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.

Implementors§