pub struct ChunkMarkdown { /* private fields */ }Expand description
A transformer that chunks markdown content into smaller pieces.
The transformer will split the markdown content into smaller pieces based on the specified
max_characters or range of characters.
For further customization, you can use the builder to create a custom splitter.
Technically that might work with every splitter text_splitter provides.
Implementations§
Source§impl ChunkMarkdown
impl ChunkMarkdown
pub fn builder() -> ChunkMarkdownBuilder
Sourcepub fn from_max_characters(max_characters: usize) -> Self
pub fn from_max_characters(max_characters: usize) -> Self
Create a new transformer with a maximum number of characters per chunk.
Sourcepub fn from_chunk_range(range: Range<usize>) -> Self
pub fn from_chunk_range(range: Range<usize>) -> Self
Create a new transformer with a range of characters per chunk.
Chunks smaller than the range will be ignored.
Sourcepub fn with_concurrency(self, concurrency: usize) -> Self
pub fn with_concurrency(self, concurrency: usize) -> Self
Set the number of concurrent chunks to process.
Trait Implementations§
Source§impl ChunkerTransformer for ChunkMarkdown
impl ChunkerTransformer for ChunkMarkdown
fn transform_node<'life0, 'async_trait>(
&'life0 self,
node: Node,
) -> Pin<Box<dyn Future<Output = IndexingStream> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn concurrency(&self) -> Option<usize>
fn concurrency(&self) -> Option<usize>
Overrides the default concurrency of the pipeline
fn name(&self) -> &'static str
Source§impl Clone for ChunkMarkdown
impl Clone for ChunkMarkdown
Source§fn clone(&self) -> ChunkMarkdown
fn clone(&self) -> ChunkMarkdown
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ChunkMarkdown
impl Debug for ChunkMarkdown
Auto Trait Implementations§
impl Freeze for ChunkMarkdown
impl RefUnwindSafe for ChunkMarkdown
impl Send for ChunkMarkdown
impl Sync for ChunkMarkdown
impl Unpin for ChunkMarkdown
impl UnwindSafe for ChunkMarkdown
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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