pub struct ConversationUsageWindow { /* private fields */ }Implementations§
Source§impl ConversationUsageWindow
impl ConversationUsageWindow
pub fn new(compact_threshold: Option<u64>) -> Self
pub fn should_compact(&self) -> bool
pub fn usage(&self) -> TokenUsage
pub fn record(&mut self, usage: TokenUsage)
pub fn reset(&mut self)
Trait Implementations§
Source§impl Clone for ConversationUsageWindow
impl Clone for ConversationUsageWindow
Source§fn clone(&self) -> ConversationUsageWindow
fn clone(&self) -> ConversationUsageWindow
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 ConversationUsageWindow
impl Debug for ConversationUsageWindow
Source§impl Default for ConversationUsageWindow
impl Default for ConversationUsageWindow
Source§fn default() -> ConversationUsageWindow
fn default() -> ConversationUsageWindow
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ConversationUsageWindow
impl RefUnwindSafe for ConversationUsageWindow
impl Send for ConversationUsageWindow
impl Sync for ConversationUsageWindow
impl Unpin for ConversationUsageWindow
impl UnsafeUnpin for ConversationUsageWindow
impl UnwindSafe for ConversationUsageWindow
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