Expand description
§lineify
Turn a token-by-token stream into stable line events. Buffers
partial lines and emits complete ones as \n arrives.
Use it to gate log lines, side effects, or persistence on whole lines instead of partial tokens.
§Example
use lineify::Lineifier;
let mut l = Lineifier::new();
assert_eq!(l.push("hel"), vec![] as Vec<String>);
assert_eq!(l.push("lo\nwor"), vec!["hello".to_string()]);
assert_eq!(l.push("ld\n"), vec!["world".to_string()]);
assert_eq!(l.flush(), "" );Structs§
- Lineifier
- Streaming line-buffer.