#[non_exhaustive]pub enum Chunking {
Word,
Line,
Regex(Regex),
UnicodeWords,
Detector(ChunkDetector),
}Expand description
How buffered text is split into chunks.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Word
A run of non-whitespace followed by whitespace (\S+\s+).
Line
Up to and including a run of newlines (\n+).
Regex(Regex)
The first match of a regular expression; the chunk spans from the buffer start to the end of the match. Empty matches are ignored.
UnicodeWords
Unicode word boundaries (UAX #29): one word plus the whitespace that follows it. Splits scripts written without spaces character by character.
Detector(ChunkDetector)
A custom detector. Lengths of zero, beyond the buffer or inside a character are ignored.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Chunking
impl !UnwindSafe for Chunking
impl Freeze for Chunking
impl Send for Chunking
impl Sync for Chunking
impl Unpin for Chunking
impl UnsafeUnpin for Chunking
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