#[non_exhaustive]pub enum UsageUnit {
InputTokens,
OutputTokens,
Images,
AudioMillis,
VideoMillis,
Characters,
Pages,
Requests,
Frames,
}Expand description
A unit a call’s usage is counted and billed in.
Serialized in camelCase (inputTokens, audioMillis), the form quota and usage
payloads key their maps by.
§Example
use adk_core::UsageUnit;
assert_eq!(UsageUnit::AudioMillis.as_str(), "audioMillis");
assert_eq!(serde_json::from_str::<UsageUnit>("\"images\"").unwrap(), UsageUnit::Images);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
InputTokens
Tokens sent to a model.
OutputTokens
Tokens a model generated, including thinking tokens.
Images
Images generated, edited or analysed.
AudioMillis
Milliseconds of audio processed or produced.
VideoMillis
Milliseconds of video processed or produced.
Characters
Characters of text processed, such as text synthesized to speech.
Pages
Document pages processed.
Requests
Requests billed as a whole.
Frames
Video frames analysed, such as frames a segmentation model tracked objects through.
Implementations§
Trait Implementations§
impl Copy for UsageUnit
Source§impl<'de> Deserialize<'de> for UsageUnit
impl<'de> Deserialize<'de> for UsageUnit
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 UsageUnit
Source§impl Ord for UsageUnit
impl Ord for UsageUnit
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for UsageUnit
impl PartialOrd for UsageUnit
impl StructuralPartialEq for UsageUnit
Auto Trait Implementations§
impl Forget for UsageUnit
impl Freeze for UsageUnit
impl Move for UsageUnit
impl RefUnwindSafe for UsageUnit
impl Send for UsageUnit
impl Sync for UsageUnit
impl Unpin for UsageUnit
impl UnsafeUnpin for UsageUnit
impl UnwindSafe for UsageUnit
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