pub struct QuotaModel {
pub capacity: f64,
pub refill_per_minute: f64,
}Expand description
A worker’s quota modeled as a refilling token bucket (CONTEXT.md §13).
The scheduler spreads load to avoid hitting limits. A subscription’s rate-limit window, an API tier’s RPM, and a free tier’s daily reset all map onto this one shape.
Fields§
§capacity: f64Maximum tokens (request units) the bucket holds.
refill_per_minute: f64Tokens refilled per minute.
Implementations§
Source§impl QuotaModel
impl QuotaModel
Sourcepub fn unlimited() -> QuotaModel
pub fn unlimited() -> QuotaModel
An effectively-unmetered bucket, for workers without a known limit.
Trait Implementations§
Source§impl Clone for QuotaModel
impl Clone for QuotaModel
Source§fn clone(&self) -> QuotaModel
fn clone(&self) -> QuotaModel
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 moreimpl Copy for QuotaModel
Source§impl Debug for QuotaModel
impl Debug for QuotaModel
Source§impl<'de> Deserialize<'de> for QuotaModel
impl<'de> Deserialize<'de> for QuotaModel
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<QuotaModel, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<QuotaModel, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for QuotaModel
impl PartialEq for QuotaModel
Source§fn eq(&self, other: &QuotaModel) -> bool
fn eq(&self, other: &QuotaModel) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for QuotaModel
impl Serialize for QuotaModel
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for QuotaModel
Auto Trait Implementations§
impl Freeze for QuotaModel
impl RefUnwindSafe for QuotaModel
impl Send for QuotaModel
impl Sync for QuotaModel
impl Unpin for QuotaModel
impl UnsafeUnpin for QuotaModel
impl UnwindSafe for QuotaModel
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