pub struct UsageData {
pub five_hour: UsagePeriod,
pub seven_day: UsagePeriod,
pub seven_day_sonnet: Option<UsagePeriod>,
pub extra_usage: Option<ExtraUsage>,
}Expand description
Main usage data returned by get_usage().
Contains utilization data for different time periods.
Fields§
§five_hour: UsagePeriod5-hour rolling window usage.
seven_day: UsagePeriod7-day rolling window usage.
seven_day_sonnet: Option<UsagePeriod>7-day Sonnet-specific usage (if applicable).
extra_usage: Option<ExtraUsage>Extra usage billing information (if enabled).
Implementations§
Source§impl UsageData
impl UsageData
Sourcepub fn five_hour_on_pace(&self) -> bool
pub fn five_hour_on_pace(&self) -> bool
Check if 5-hour usage is on pace.
Returns true if current 5-hour utilization is sustainable.
Sourcepub fn seven_day_on_pace(&self) -> bool
pub fn seven_day_on_pace(&self) -> bool
Check if 7-day usage is on pace.
Returns true if current 7-day utilization is sustainable.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for UsageData
impl<'de> Deserialize<'de> for UsageData
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 StructuralPartialEq for UsageData
Auto Trait Implementations§
impl Freeze for UsageData
impl RefUnwindSafe for UsageData
impl Send for UsageData
impl Sync for UsageData
impl Unpin for UsageData
impl UnwindSafe for UsageData
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