pub struct CollectedStreams { /* private fields */ }Expand description
The buffer behind PrintWriter::CollectStreams: (stream, text) entries
plus the running charge their cap is checked against.
The charge is carried rather than re-derived because the cap is checked on
every fragment: summing the entries each time is O(entries), which a run
alternating between the streams turns into quadratic work, since each switch
starts a new entry. pydantic_monty’s collector keeps the same running
charge for the same reason.
Implementations§
Source§impl CollectedStreams
impl CollectedStreams
Sourcepub fn entries(&self) -> &[(PrintStream, String)]
pub fn entries(&self) -> &[(PrintStream, String)]
The collected fragments, in the order the sandbox produced them.
Sourcepub fn into_entries(self) -> Vec<(PrintStream, String)>
pub fn into_entries(self) -> Vec<(PrintStream, String)>
Takes the collected fragments, leaving the buffer empty.
Trait Implementations§
Source§impl Debug for CollectedStreams
impl Debug for CollectedStreams
Auto Trait Implementations§
impl Freeze for CollectedStreams
impl RefUnwindSafe for CollectedStreams
impl Send for CollectedStreams
impl Sync for CollectedStreams
impl Unpin for CollectedStreams
impl UnsafeUnpin for CollectedStreams
impl UnwindSafe for CollectedStreams
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