pub struct CompactionMessageGroup {
pub kind: CompactionGroupKind,
pub messages: Vec<Message>,
pub turn_index: Option<usize>,
pub token_count: usize,
pub byte_count: usize,
pub is_excluded: bool,
pub exclude_reason: Option<String>,
}Expand description
An atomic run of messages a strategy keeps or drops as a whole.
Fields§
§kind: CompactionGroupKindWhat the group holds.
messages: Vec<Message>The messages, in conversation order.
turn_index: Option<usize>The zero-based user turn the group belongs to; None for system
groups. Groups before the first user message are in turn 0.
token_count: usizeThe group’s token cost under the index’s tokenizer.
byte_count: usizeThe group’s size as serialized JSON, in bytes.
is_excluded: boolWhether a strategy has excluded the group.
exclude_reason: Option<String>Why it was excluded, if it was.
Implementations§
Source§impl CompactionMessageGroup
impl CompactionMessageGroup
Sourcepub fn message_count(&self) -> usize
pub fn message_count(&self) -> usize
The number of messages in the group.
Trait Implementations§
Source§impl Clone for CompactionMessageGroup
impl Clone for CompactionMessageGroup
Source§fn clone(&self) -> CompactionMessageGroup
fn clone(&self) -> CompactionMessageGroup
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 moreAuto Trait Implementations§
impl Freeze for CompactionMessageGroup
impl RefUnwindSafe for CompactionMessageGroup
impl Send for CompactionMessageGroup
impl Sync for CompactionMessageGroup
impl Unpin for CompactionMessageGroup
impl UnsafeUnpin for CompactionMessageGroup
impl UnwindSafe for CompactionMessageGroup
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