pub struct MarkdownStructureSplitter { /* private fields */ }Expand description
Heading-aware markdown splitter.
Construct via Self::new for the default [1, 2, 3]
configuration, or Self::with_heading_levels to widen / narrow
the split granularity.
Implementations§
Source§impl MarkdownStructureSplitter
impl MarkdownStructureSplitter
Sourcepub fn with_heading_levels<I>(self, levels: I) -> Selfwhere
I: IntoIterator<Item = u8>,
pub fn with_heading_levels<I>(self, levels: I) -> Selfwhere
I: IntoIterator<Item = u8>,
Override which ATX heading levels open a new chunk. Levels
outside 1..=6 are silently ignored at split time. Order
is irrelevant — duplicates are tolerated.
Sourcepub fn heading_levels(&self) -> &[u8] ⓘ
pub fn heading_levels(&self) -> &[u8] ⓘ
Borrow the configured heading levels.
Trait Implementations§
Source§impl Clone for MarkdownStructureSplitter
impl Clone for MarkdownStructureSplitter
Source§fn clone(&self) -> MarkdownStructureSplitter
fn clone(&self) -> MarkdownStructureSplitter
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 MarkdownStructureSplitter
impl Debug for MarkdownStructureSplitter
Source§impl Default for MarkdownStructureSplitter
impl Default for MarkdownStructureSplitter
Source§impl TextSplitter for MarkdownStructureSplitter
impl TextSplitter for MarkdownStructureSplitter
Source§fn name(&self) -> &'static str
fn name(&self) -> &'static str
Stable splitter identifier — surfaces on every produced
chunk’s
Lineage::splitter
field. "recursive-character", "markdown-structure",
"token-count", etc.Source§fn split(&self, document: &Document) -> Vec<Document>
fn split(&self, document: &Document) -> Vec<Document>
Slice
document and return the resulting chunks. Returning
a single-element vec equal to the input is a valid no-op
(e.g. when the document already fits the target size); an
empty vec is also valid (e.g. content is whitespace-only). Read moreAuto Trait Implementations§
impl Freeze for MarkdownStructureSplitter
impl RefUnwindSafe for MarkdownStructureSplitter
impl Send for MarkdownStructureSplitter
impl Sync for MarkdownStructureSplitter
impl Unpin for MarkdownStructureSplitter
impl UnsafeUnpin for MarkdownStructureSplitter
impl UnwindSafe for MarkdownStructureSplitter
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