pub struct LogSlicer { /* private fields */ }Expand description
Condenses command and build output.
§Example
use boundgraph_slice::{LogSlicer, MemoryStore, Raw, Slicer};
let noisy = (0..5_000)
.map(|i| format!("Compiling crate_{i}"))
.collect::<Vec<_>>()
.join("\n")
+ "\nerror[E0308]: mismatched types\n";
let condensate = tokio::runtime::Builder::new_current_thread()
.build()?
.block_on(LogSlicer::new().condense(&Raw::new(noisy), 300, &MemoryStore::new()))?;
// The error survived; the five thousand Compiling lines did not.
assert!(condensate.lossy);Implementations§
Trait Implementations§
impl Copy for LogSlicer
Source§impl Slicer for LogSlicer
impl Slicer for LogSlicer
Source§fn slice<'life0, 'life1, 'async_trait>(
&'life0 self,
raw: &'life1 Raw,
cap: usize,
) -> Pin<Box<dyn Future<Output = Result<Slice, SliceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn slice<'life0, 'life1, 'async_trait>(
&'life0 self,
raw: &'life1 Raw,
cap: usize,
) -> Pin<Box<dyn Future<Output = Result<Slice, SliceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Produce the summary. The part an implementation writes. Read more
Source§fn counter(&self) -> &dyn TokenCount
fn counter(&self) -> &dyn TokenCount
How this slicer counts tokens. Read more
Source§fn minimum_cap(&self) -> usize
fn minimum_cap(&self) -> usize
The least a summary from this slicer can cost. Read more
Source§fn condense<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
raw: &'life1 Raw,
cap: usize,
store: &'life2 dyn Store,
) -> Pin<Box<dyn Future<Output = Result<Condensate, SliceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn condense<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
raw: &'life1 Raw,
cap: usize,
store: &'life2 dyn Store,
) -> Pin<Box<dyn Future<Output = Result<Condensate, SliceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Preserve the original, slice it, and check the result fits. Read more
Auto Trait Implementations§
impl Freeze for LogSlicer
impl RefUnwindSafe for LogSlicer
impl Send for LogSlicer
impl Sync for LogSlicer
impl Unpin for LogSlicer
impl UnsafeUnpin for LogSlicer
impl UnwindSafe for LogSlicer
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