pub struct ChunkerRegistry {
chunkers: HashMap<String, Arc<dyn Chunker>>,
type_mapping: HashMap<String, String>,
default_chunker: Option<String>,
}Expand description
Registry of chunking strategies.
Fields§
§chunkers: HashMap<String, Arc<dyn Chunker>>Named chunkers
type_mapping: HashMap<String, String>Content type to chunker name mapping
default_chunker: Option<String>Default chunker name
Implementations§
Source§impl ChunkerRegistry
impl ChunkerRegistry
Sourcepub fn set_default(&mut self, name: &str)
pub fn set_default(&mut self, name: &str)
Set the default chunker.
Sourcepub fn get_for_content_type(
&self,
content_type: &ContentType,
) -> Option<Arc<dyn Chunker>>
pub fn get_for_content_type( &self, content_type: &ContentType, ) -> Option<Arc<dyn Chunker>>
Get a chunker for a content type.
Sourcepub async fn chunk(
&self,
content: &ExtractedContent,
content_type: &ContentType,
config: &ChunkConfig,
) -> Result<Vec<ChunkOutput>, ChunkError>
pub async fn chunk( &self, content: &ExtractedContent, content_type: &ContentType, config: &ChunkConfig, ) -> Result<Vec<ChunkOutput>, ChunkError>
Chunk content using appropriate strategy.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ChunkerRegistry
impl !RefUnwindSafe for ChunkerRegistry
impl Send for ChunkerRegistry
impl Sync for ChunkerRegistry
impl Unpin for ChunkerRegistry
impl !UnwindSafe for ChunkerRegistry
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