pub struct FileCostMeter { /* private fields */ }Expand description
Durable cost meter with optional per-session token budget.
Implementations§
Trait Implementations§
Source§impl CostMeterPort for FileCostMeter
impl CostMeterPort for FileCostMeter
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 FileCostMeter
impl !RefUnwindSafe for FileCostMeter
impl Send for FileCostMeter
impl Sync for FileCostMeter
impl Unpin for FileCostMeter
impl UnsafeUnpin for FileCostMeter
impl !UnwindSafe for FileCostMeter
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