pub struct UsageDimensions { /* private fields */ }Expand description
Named resource dimensions for one provider invocation.
Implementations§
Source§impl UsageDimensions
impl UsageDimensions
pub const INPUT_TOKENS: &'static str = "input_tokens"
pub const OUTPUT_TOKENS: &'static str = "output_tokens"
pub const CACHED_INPUT_TOKENS: &'static str = "cached_input_tokens"
pub const REASONING_TOKENS: &'static str = "reasoning_tokens"
pub fn new() -> Self
pub fn with(self, name: impl Into<String>, value: MeteredValue) -> Self
pub fn get(&self, name: &str) -> MeteredValue
pub fn iter(&self) -> impl Iterator<Item = (&str, MeteredValue)>
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for UsageDimensions
impl Clone for UsageDimensions
Source§impl Debug for UsageDimensions
impl Debug for UsageDimensions
Source§impl Default for UsageDimensions
impl Default for UsageDimensions
Source§impl<'de> Deserialize<'de> for UsageDimensions
impl<'de> Deserialize<'de> for UsageDimensions
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
impl Eq for UsageDimensions
Source§impl PartialEq for UsageDimensions
impl PartialEq for UsageDimensions
Source§impl Serialize for UsageDimensions
impl Serialize for UsageDimensions
impl StructuralPartialEq for UsageDimensions
Auto Trait Implementations§
impl Freeze for UsageDimensions
impl RefUnwindSafe for UsageDimensions
impl Send for UsageDimensions
impl Sync for UsageDimensions
impl Unpin for UsageDimensions
impl UnsafeUnpin for UsageDimensions
impl UnwindSafe for UsageDimensions
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