pub struct RemoteUsageWindow {
pub used_percent: f64,
pub resets_at_unix: Option<i64>,
pub window_minutes: Option<u32>,
}Expand description
One rate-limit window: how much of it is gone, and when it comes back.
Not Eq, and none of the usage types are: a percentage is a fraction and
rounding it to an integer to keep a derive would be inventing precision the
source does not have.
Fields§
§used_percent: f640–100, as the agent reports it. Not clamped here: a provider that says 103 is telling the user something true about their account, and a phone showing a full bar is a better answer than one showing a wrong number.
resets_at_unix: Option<i64>Unix seconds. Absent when the agent did not say — which is how both agents spell “no window is active” and must not read as “resets at the epoch”.
window_minutes: Option<u32>Trait Implementations§
Source§impl Clone for RemoteUsageWindow
impl Clone for RemoteUsageWindow
Source§fn clone(&self) -> RemoteUsageWindow
fn clone(&self) -> RemoteUsageWindow
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 RemoteUsageWindow
impl Debug for RemoteUsageWindow
Source§impl<'de> Deserialize<'de> for RemoteUsageWindow
impl<'de> Deserialize<'de> for RemoteUsageWindow
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 PartialEq for RemoteUsageWindow
impl PartialEq for RemoteUsageWindow
Source§impl Serialize for RemoteUsageWindow
impl Serialize for RemoteUsageWindow
impl StructuralPartialEq for RemoteUsageWindow
Auto Trait Implementations§
impl Freeze for RemoteUsageWindow
impl RefUnwindSafe for RemoteUsageWindow
impl Send for RemoteUsageWindow
impl Sync for RemoteUsageWindow
impl Unpin for RemoteUsageWindow
impl UnsafeUnpin for RemoteUsageWindow
impl UnwindSafe for RemoteUsageWindow
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