pub struct CostTable { /* private fields */ }Implementations§
Source§impl CostTable
impl CostTable
Sourcepub fn estimate(
&self,
model: Option<&str>,
tokens_in: u32,
tokens_out: u32,
) -> i64
pub fn estimate( &self, model: Option<&str>, tokens_in: u32, tokens_out: u32, ) -> i64
Estimate cost in cost_usd_e6 units. If model is None or not found, falls back to “cursor” heuristic entry. If tokens_in == 0 and tokens_out == 0 (Cursor: no native tokens), uses avg_tokens_per_turn from the matched entry.
pub fn find(&self, model: &str) -> Option<&ModelPrice>
Auto Trait Implementations§
impl Freeze for CostTable
impl RefUnwindSafe for CostTable
impl Send for CostTable
impl Sync for CostTable
impl Unpin for CostTable
impl UnsafeUnpin for CostTable
impl UnwindSafe for CostTable
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more