pub struct StreamCleaner { /* private fields */ }Expand description
Incremental cleaner that processes text in newline-delimited chunks.
Implementations§
Source§impl StreamCleaner
impl StreamCleaner
Sourcepub fn new(options: CleaningOptions) -> Self
pub fn new(options: CleaningOptions) -> Self
Construct a streaming cleaner from options.
§Arguments
options: Cleaning behavior configuration.
§Returns
A new StreamCleaner.
Sourcepub fn from_cleaner(cleaner: TextCleaner) -> Self
pub fn from_cleaner(cleaner: TextCleaner) -> Self
Construct a streaming cleaner from an existing TextCleaner.
§Arguments
cleaner: Preconfigured text cleaner.
§Returns
A new StreamCleaner.
Sourcepub fn feed<'out>(
&mut self,
chunk: &str,
out: &'out mut String,
) -> Option<CleaningResult<'out>>
pub fn feed<'out>( &mut self, chunk: &str, out: &'out mut String, ) -> Option<CleaningResult<'out>>
Feed one input chunk and emit cleaned output only after a newline boundary is available.
§Arguments
chunk: Incoming text data.out: Reusable output buffer.
§Returns
Some(CleaningResult) when at least one complete line was processed,
otherwise None.
§Panics
Panics when normalization is requested but the unorm feature is disabled.
Sourcepub fn finish<'out>(
&mut self,
out: &'out mut String,
) -> Option<CleaningResult<'out>>
pub fn finish<'out>( &mut self, out: &'out mut String, ) -> Option<CleaningResult<'out>>
Sourcepub fn summary(&self) -> StreamSummary
pub fn summary(&self) -> StreamSummary
Auto Trait Implementations§
impl Freeze for StreamCleaner
impl RefUnwindSafe for StreamCleaner
impl Send for StreamCleaner
impl Sync for StreamCleaner
impl Unpin for StreamCleaner
impl UnsafeUnpin for StreamCleaner
impl UnwindSafe for StreamCleaner
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