#[non_exhaustive]pub struct CachedData {
pub five_hour: Option<UsageBucket>,
pub seven_day: Option<UsageBucket>,
pub seven_day_opus: Option<UsageBucket>,
pub seven_day_sonnet: Option<UsageBucket>,
pub seven_day_oauth_apps: Option<UsageBucket>,
pub extra_usage: Option<ExtraUsage>,
pub unknown_buckets: HashMap<String, Value>,
}Expand description
Disk-serializable mirror of UsageApiResponse. The wire shape
uses #[serde(flatten)] for unknown_buckets so codenamed keys
appear at the top level of the endpoint response. The cache nests
them under a named unknown_buckets key so the outer
CachedUsage wrapper’s fields (schema_version, cached_at,
etc.) don’t collide with endpoint-emitted keys like five_hour.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.five_hour: Option<UsageBucket>§seven_day: Option<UsageBucket>§seven_day_opus: Option<UsageBucket>§seven_day_sonnet: Option<UsageBucket>§seven_day_oauth_apps: Option<UsageBucket>§extra_usage: Option<ExtraUsage>§unknown_buckets: HashMap<String, Value>Trait Implementations§
Source§impl Clone for CachedData
impl Clone for CachedData
Source§fn clone(&self) -> CachedData
fn clone(&self) -> CachedData
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CachedData
impl Debug for CachedData
Source§impl<'de> Deserialize<'de> for CachedData
impl<'de> Deserialize<'de> for CachedData
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
Source§impl From<CachedData> for UsageApiResponse
impl From<CachedData> for UsageApiResponse
Source§fn from(c: CachedData) -> Self
fn from(c: CachedData) -> Self
Converts to this type from the input type.
Source§impl From<UsageApiResponse> for CachedData
impl From<UsageApiResponse> for CachedData
Source§fn from(r: UsageApiResponse) -> Self
fn from(r: UsageApiResponse) -> Self
Converts to this type from the input type.
Source§impl PartialEq for CachedData
impl PartialEq for CachedData
Source§fn eq(&self, other: &CachedData) -> bool
fn eq(&self, other: &CachedData) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for CachedData
impl Serialize for CachedData
impl StructuralPartialEq for CachedData
Auto Trait Implementations§
impl Freeze for CachedData
impl RefUnwindSafe for CachedData
impl Send for CachedData
impl Sync for CachedData
impl Unpin for CachedData
impl UnsafeUnpin for CachedData
impl UnwindSafe for CachedData
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