pub struct MaxMessages {
pub max: usize,
}Expand description
Drop oldest non-system messages until max remains.
Fields§
§max: usizeMaximum messages retained (including system).
Implementations§
Source§impl MaxMessages
impl MaxMessages
Sourcepub fn new(max: usize) -> Result<MaxMessages, MachiError>
pub fn new(max: usize) -> Result<MaxMessages, MachiError>
Trait Implementations§
Source§impl Clone for MaxMessages
impl Clone for MaxMessages
Source§fn clone(&self) -> MaxMessages
fn clone(&self) -> MaxMessages
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 CompactionStrategy for MaxMessages
impl CompactionStrategy for MaxMessages
Source§fn should_compact(&self, messages: &[Message], _token_estimate: u64) -> bool
fn should_compact(&self, messages: &[Message], _token_estimate: u64) -> bool
Whether compaction should run given current size estimates.
Source§fn compact(
&self,
messages: Vec<Message>,
) -> Result<CompactionOutcome, MachiError>
fn compact( &self, messages: Vec<Message>, ) -> Result<CompactionOutcome, MachiError>
Produce a compacted message list. Read more
impl Copy for MaxMessages
Auto Trait Implementations§
impl Freeze for MaxMessages
impl RefUnwindSafe for MaxMessages
impl Send for MaxMessages
impl Sync for MaxMessages
impl Unpin for MaxMessages
impl UnsafeUnpin for MaxMessages
impl UnwindSafe for MaxMessages
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