#[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 fail the stream.
UnicodeWords
The first Unicode word-boundary segment (UAX #29), emitted immediately. Whitespace and punctuation are separate segments; locale dictionaries and ICU tailoring require an application-supplied detector.
Detector(ChunkDetector)
A custom detector. Lengths of zero, beyond the buffer or inside a character fail the smoothing stream.
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