pub struct BillingCache {
pub tier: String,
pub facts_used: u64,
pub facts_limit: u64,
pub features: FeatureFlags,
pub checked_at: u64,
}Expand description
Cached billing status, matching the TypeScript BillingCache interface.
Fields§
§tier: String§facts_used: u64§facts_limit: u64§features: FeatureFlags§checked_at: u64Unix epoch millis when this cache was written.
Implementations§
Source§impl BillingCache
impl BillingCache
Sourcepub fn quota_fraction(&self) -> f64
pub fn quota_fraction(&self) -> f64
Quota usage as a fraction (0.0 to 1.0).
Sourcepub fn is_quota_warning(&self) -> bool
pub fn is_quota_warning(&self) -> bool
Whether the user is above the 80% quota warning threshold.
Sourcepub fn quota_warning_message(&self) -> Option<String>
pub fn quota_warning_message(&self) -> Option<String>
Human-readable quota warning message (or None if under threshold).
Trait Implementations§
Source§impl Clone for BillingCache
impl Clone for BillingCache
Source§fn clone(&self) -> BillingCache
fn clone(&self) -> BillingCache
Returns a duplicate of the value. Read more
1.0.0 · 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 BillingCache
impl Debug for BillingCache
Source§impl<'de> Deserialize<'de> for BillingCache
impl<'de> Deserialize<'de> for BillingCache
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
Auto Trait Implementations§
impl Freeze for BillingCache
impl RefUnwindSafe for BillingCache
impl Send for BillingCache
impl Sync for BillingCache
impl Unpin for BillingCache
impl UnsafeUnpin for BillingCache
impl UnwindSafe for BillingCache
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