pub struct Partition {
pub messages: Vec<CoreMessage>,
pub measurements: Vec<TokenMeasurement>,
pub token_count: u32,
}Expand description
A single context partition — a named bucket of messages with a token counter.
Fields§
§messages: Vec<CoreMessage>§measurements: Vec<TokenMeasurement>Host-side measurements aligned with messages; not part of canonical message state.
token_count: u32Implementations§
Source§impl Partition
impl Partition
pub fn new() -> Self
pub fn push(&mut self, msg: CoreMessage, token_count: u32)
pub fn clear(&mut self)
pub fn measured_tokens(&self, index: usize, engine: &ContextTokenEngine) -> u32
pub fn set_measured_tokens(&mut self, index: usize, tokens: u32)
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Partition
impl RefUnwindSafe for Partition
impl Send for Partition
impl Sync for Partition
impl Unpin for Partition
impl UnsafeUnpin for Partition
impl UnwindSafe for Partition
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