pub struct CodeChunker;Expand description
Code-aware chunker that splits at function/class boundaries.
Implementations§
Source§impl CodeChunker
impl CodeChunker
Sourcefn detect_language(content: &ExtractedContent) -> Option<Language>
fn detect_language(content: &ExtractedContent) -> Option<Language>
Detect language from metadata or infer from content.
Trait Implementations§
Source§impl Chunker for CodeChunker
impl Chunker for CodeChunker
Source§fn content_types(&self) -> &[&str]
fn content_types(&self) -> &[&str]
Content types this chunker is designed for.
Source§fn 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.
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,
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.
Auto Trait Implementations§
impl Freeze for CodeChunker
impl RefUnwindSafe for CodeChunker
impl Send for CodeChunker
impl Sync for CodeChunker
impl Unpin for CodeChunker
impl UnwindSafe for CodeChunker
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