pub struct QuotaMode(/* private fields */);Expand description
Supported quota modes.
Implementations§
Source§impl QuotaMode
impl QuotaMode
Sourcepub const UNSPECIFIED: QuotaMode
pub const UNSPECIFIED: QuotaMode
Guard against implicit default. Must not be used.
Sourcepub const NORMAL: QuotaMode
pub const NORMAL: QuotaMode
For AllocateQuota request, allocates quota for the amount specified in the service configuration or specified using the quota metrics. If the amount is higher than the available quota, allocation error will be returned and no quota will be allocated. If multiple quotas are part of the request, and one fails, none of the quotas are allocated or released.
Sourcepub const BEST_EFFORT: QuotaMode
pub const BEST_EFFORT: QuotaMode
The operation allocates quota for the amount specified in the service configuration or specified using the quota metrics. If the amount is higher than the available quota, request does not fail but all available quota will be allocated. For rate quota, BEST_EFFORT will continue to deduct from other groups even if one does not have enough quota. For allocation, it will find the minimum available amount across all groups and deduct that amount from all the affected groups.
Sourcepub const CHECK_ONLY: QuotaMode
pub const CHECK_ONLY: QuotaMode
For AllocateQuota request, only checks if there is enough quota available and does not change the available quota. No lock is placed on the available quota either.
Sourcepub const QUERY_ONLY: QuotaMode
pub const QUERY_ONLY: QuotaMode
Unimplemented. When used in AllocateQuotaRequest, this returns the effective quota limit(s) in the response, and no quota check will be performed. Not supported for other requests, and even for AllocateQuotaRequest, this is currently supported only for allowlisted services.
Sourcepub const ADJUST_ONLY: QuotaMode
pub const ADJUST_ONLY: QuotaMode
The operation allocates quota for the amount specified in the service configuration or specified using the quota metrics. If the requested amount is higher than the available quota, request does not fail and remaining quota would become negative (going over the limit). Not supported for Rate Quota.
Sourcepub fn as_str_name(&self) -> Cow<'static, str>
pub fn as_str_name(&self) -> Cow<'static, str>
Gets the enum value as a string.
Sourcepub fn from_str_name(name: &str) -> Option<Self>
pub fn from_str_name(name: &str) -> Option<Self>
Creates an enum value from the value name.