#[non_exhaustive]pub struct CompactionReport {
pub before: usize,
pub after: usize,
pub strategy: &'static str,
}Expand description
Reports what History::compact_if_needed did when it ran.
Returned wrapped in Option: None means compaction was not needed
(history fits within max_tokens).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.before: usizeMessage count before compaction ran.
after: usizeMessage count after compaction ran. after < before whenever
the strategy actually dropped or replaced messages.
strategy: &'static strStable, machine-readable strategy name from
CompactionStrategy::name (e.g. "truncate",
"summarize"). Used as the strategy field of
StreamChunk::HistoryCompacted.
Trait Implementations§
Source§impl Clone for CompactionReport
impl Clone for CompactionReport
Source§fn clone(&self) -> CompactionReport
fn clone(&self) -> CompactionReport
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CompactionReport
impl Debug for CompactionReport
Source§impl PartialEq for CompactionReport
impl PartialEq for CompactionReport
Source§fn eq(&self, other: &CompactionReport) -> bool
fn eq(&self, other: &CompactionReport) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for CompactionReport
impl StructuralPartialEq for CompactionReport
Auto Trait Implementations§
impl Freeze for CompactionReport
impl RefUnwindSafe for CompactionReport
impl Send for CompactionReport
impl Sync for CompactionReport
impl Unpin for CompactionReport
impl UnsafeUnpin for CompactionReport
impl UnwindSafe for CompactionReport
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