pub struct BoundedLineReader<R: Read> { /* private fields */ }Expand description
Bounded line reader (P→S direction): scans for \n in fixed-size
chunks, refusing to buffer past max bytes without one.
Implementations§
Source§impl<R: Read> BoundedLineReader<R>
impl<R: Read> BoundedLineReader<R>
pub fn new(inner: R) -> Self
Sourcepub fn read_line(&mut self, max: usize) -> Result<String, LineError>
pub fn read_line(&mut self, max: usize) -> Result<String, LineError>
Reads one \n-terminated line (returned without the newline,
as a lossy UTF-8 string — the carrier is UTF-8 JSON, §7.1).
Err(Overflow) leaves the stream position undefined; the
runner quarantines and kills the child rather than resyncing.
Sourcepub fn discard_line(&mut self) -> bool
pub fn discard_line(&mut self) -> bool
Discards through the next \n (or EOF), memory-bounded — the
stderr drainer’s resync after an oversized line: bytes are
dropped, never buffered (§10.5).
Auto Trait Implementations§
impl<R> Forget for BoundedLineReader<R>
impl<R> Freeze for BoundedLineReader<R>
impl<R> Move for BoundedLineReader<R>
impl<R> RefUnwindSafe for BoundedLineReader<R>where
R: RefUnwindSafe,
impl<R> Send for BoundedLineReader<R>
impl<R> Sync for BoundedLineReader<R>
impl<R> Unpin for BoundedLineReader<R>
impl<R> UnsafeUnpin for BoundedLineReader<R>
impl<R> UnwindSafe for BoundedLineReader<R>where
R: UnwindSafe,
RawVecInner: UnwindSafe,
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