#[non_exhaustive]pub struct ContextSnapshot {
pub message_count: usize,
pub message_metas: Vec<MessageMeta>,
pub has_system: bool,
pub operator_id: OperatorId,
pub estimated_tokens: usize,
}Expand description
Read-only snapshot of an OperatorContext for introspection and logging.
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.message_count: usizeNumber of messages currently in the context.
message_metas: Vec<MessageMeta>Metadata for each message, in order.
has_system: boolWhether a system prompt is currently set.
operator_id: OperatorIdThe operator this context belongs to.
estimated_tokens: usizeRough token estimate derived from the debug representation length of messages.
Uses the heuristic total_chars / 4. Not suitable for billing — use it for
soft pressure signals only.
Trait Implementations§
Source§impl Clone for ContextSnapshot
impl Clone for ContextSnapshot
Source§fn clone(&self) -> ContextSnapshot
fn clone(&self) -> ContextSnapshot
Returns a duplicate of the value. Read more
1.0.0 · 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 ContextSnapshot
impl Debug for ContextSnapshot
Source§impl<'de> Deserialize<'de> for ContextSnapshot
impl<'de> Deserialize<'de> for ContextSnapshot
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ContextSnapshot
impl RefUnwindSafe for ContextSnapshot
impl Send for ContextSnapshot
impl Sync for ContextSnapshot
impl Unpin for ContextSnapshot
impl UnsafeUnpin for ContextSnapshot
impl UnwindSafe for ContextSnapshot
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