pub struct OutputBuffer { /* private fields */ }Expand description
Single ring buffer storing all output with source tags. Stdout/stderr views are filtered from the same data — no duplication.
Implementations§
Source§impl OutputBuffer
impl OutputBuffer
pub fn new(max_lines: usize) -> Self
pub fn push(&mut self, source: LineSource, line: String)
pub fn is_empty(&self) -> bool
Sourcepub fn stdout_count(&self) -> usize
pub fn stdout_count(&self) -> usize
O(1) count of stdout lines.
Sourcepub fn stderr_count(&self) -> usize
pub fn stderr_count(&self) -> usize
O(1) count of stderr lines.
pub fn stdout_lines(&self) -> impl Iterator<Item = &str>
pub fn stderr_lines(&self) -> impl Iterator<Item = &str>
pub fn all_lines(&self) -> impl Iterator<Item = (LineSource, &str)>
Auto Trait Implementations§
impl Freeze for OutputBuffer
impl RefUnwindSafe for OutputBuffer
impl Send for OutputBuffer
impl Sync for OutputBuffer
impl Unpin for OutputBuffer
impl UnsafeUnpin for OutputBuffer
impl UnwindSafe for OutputBuffer
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more