pub struct OutputLimit {
pub lines: usize,
pub bytes: usize,
}Expand description
How much of a long output a tool keeps: at most lines lines and
bytes bytes, of whole lines. tail keeps the last ones;
Shell keeps a quarter for the first lines, a quarter for the errors
and failures from between, and the rest for the last lines.
use rig_tools::OutputLimit;
let cut = OutputLimit { lines: 2, bytes: 1024 };
assert_eq!(cut.tail("one\ntwo\nthree\n"), ("two\nthree\n", 1));
let narrow = OutputLimit { lines: 10, bytes: 7 };
assert_eq!(narrow.tail("one\ntwo\nthree\n"), ("three\n", 2));Fields§
§lines: usizeMost lines kept.
bytes: usizeMost bytes kept.
Implementations§
Trait Implementations§
Source§impl Clone for OutputLimit
impl Clone for OutputLimit
impl Copy for OutputLimit
Source§impl Debug for OutputLimit
impl Debug for OutputLimit
impl Eq for OutputLimit
Source§impl PartialEq for OutputLimit
impl PartialEq for OutputLimit
impl StructuralPartialEq for OutputLimit
Auto Trait Implementations§
impl Freeze for OutputLimit
impl RefUnwindSafe for OutputLimit
impl Send for OutputLimit
impl Sync for OutputLimit
impl Unpin for OutputLimit
impl UnsafeUnpin for OutputLimit
impl UnwindSafe for OutputLimit
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.