pub struct SimpleCostMeter { /* private fields */ }Expand description
In-memory cost meter with optional per-session token budget.
Implementations§
Trait Implementations§
Source§impl CostMeterPort for SimpleCostMeter
impl CostMeterPort for SimpleCostMeter
fn check_budget<'life0, 'life1, 'async_trait>(
&'life0 self,
session_id: &'life1 SessionId,
) -> Pin<Box<dyn Future<Output = Result<(), CostError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn record_llm_usage<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
session_id: &'life1 SessionId,
_model: &'life2 str,
usage: &'life3 TokenUsage,
) -> Pin<Box<dyn Future<Output = Result<(), CostError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn record_tool_result<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
session_id: &'life1 SessionId,
_tool_result: &'life2 ToolResult,
) -> Pin<Box<dyn Future<Output = Result<(), CostError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Auto Trait Implementations§
impl !Freeze for SimpleCostMeter
impl RefUnwindSafe for SimpleCostMeter
impl Send for SimpleCostMeter
impl Sync for SimpleCostMeter
impl Unpin for SimpleCostMeter
impl UnsafeUnpin for SimpleCostMeter
impl UnwindSafe for SimpleCostMeter
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