Struct text_splitter::Characters
source · pub struct Characters;Expand description
Used for splitting a piece of text into chunks based on the number of characters in each chunk.
use text_splitter::{Characters, TextSplitter};
let splitter = TextSplitter::new(Characters);Trait Implementations§
source§impl ChunkSizer for Characters
impl ChunkSizer for Characters
source§fn chunk_size(&self, chunk: &str) -> usize
fn chunk_size(&self, chunk: &str) -> usize
Determine the size of a given chunk to use for validation.
use text_splitter::{Characters, ChunkSizer};
assert_eq!(Characters.chunk_size("hello"), 5);Auto Trait Implementations§
impl RefUnwindSafe for Characters
impl Send for Characters
impl Sync for Characters
impl Unpin for Characters
impl UnwindSafe for Characters
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