pub struct ResidueScanner {
markers: Vec<String>,
max_marker_len: usize,
tail: String,
hit: Option<String>,
}Expand description
Chunk-safe residue scanner. See the module docs.
Fields§
§markers: Vec<String>Markers to scan for: the active spec’s (if any) ∪ the known set.
max_marker_len: usizeLongest marker length in bytes — bounds the retained tail.
tail: StringTail of the previous chunk that could still open a marker.
hit: Option<String>First marker found, if any. Sticky.
Implementations§
Source§impl ResidueScanner
impl ResidueScanner
Sourcepub fn new(dialect: Option<&DialectSpec>) -> Self
pub fn new(dialect: Option<&DialectSpec>) -> Self
Build a scanner for a model with the given resolved dialect.
Sourcepub fn feed(&mut self, chunk: &str)
pub fn feed(&mut self, chunk: &str)
Scan one chunk of client-visible text.
Cheap after the first hit (immediately returns). Never alters the text — the caller forwards it regardless.
fn scan(&self, window: &str) -> Option<String>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ResidueScanner
impl RefUnwindSafe for ResidueScanner
impl Send for ResidueScanner
impl Sync for ResidueScanner
impl Unpin for ResidueScanner
impl UnsafeUnpin for ResidueScanner
impl UnwindSafe for ResidueScanner
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