pub struct CharacterSplitter { /* private fields */ }Expand description
Single-separator character splitter.
Implementations§
Source§impl CharacterSplitter
impl CharacterSplitter
Sourcepub fn with_chunk_size(self, n: usize) -> Self
pub fn with_chunk_size(self, n: usize) -> Self
Set the maximum chunk size measured by length_fn (default: chars).
Sourcepub fn with_overlap(self, n: usize) -> Self
pub fn with_overlap(self, n: usize) -> Self
Set the overlap between adjacent chunks.
Sourcepub fn with_separator(self, s: impl Into<String>) -> Self
pub fn with_separator(self, s: impl Into<String>) -> Self
Set the separator string used to split text. Default: "\n\n".
Sourcepub fn with_keep_separator(self, keep: bool) -> Self
pub fn with_keep_separator(self, keep: bool) -> Self
If true, the separator is prepended to subsequent chunks
(preserving boundary context). Default: false.
Trait Implementations§
Source§impl Debug for CharacterSplitter
impl Debug for CharacterSplitter
Source§impl Default for CharacterSplitter
impl Default for CharacterSplitter
Auto Trait Implementations§
impl Freeze for CharacterSplitter
impl !RefUnwindSafe for CharacterSplitter
impl Send for CharacterSplitter
impl Sync for CharacterSplitter
impl Unpin for CharacterSplitter
impl UnsafeUnpin for CharacterSplitter
impl !UnwindSafe for CharacterSplitter
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