#[non_exhaustive]pub enum QuotaScope {
Account,
Domain,
Global,
Other(String),
}Expand description
RFC 9425 §3.1 Scope — the set of accounts the quota limit applies to.
Wire strings: "account", "domain", "global".
Other(String) preserves any unrecognized value for lossless round-trip.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Account
Quota applies to this account only.
Domain
Quota applies to all accounts sharing this domain.
Global
Quota applies to all accounts on the server.
Other(String)
Catch-all for any unrecognized wire value from a future spec version. The original wire value is preserved for lossless round-trip.
§Forging caveat
Other(String) is pub, so callers can construct
QuotaScope::Other("account".into()). The custom serde impl
emits the wrapped string verbatim on serialize and normalises
canonical wire strings to their typed variant on deserialize.
Consequences:
QuotaScope::Other("account".into()) != QuotaScope::Accounton PartialEq, but both serialize to"account".Other("account")->"account"->Accountis a lossy round-trip (the variant changes shape).
Reserve Other(s) for genuinely unrecognised wire strings.
Comparing wire-string equality across two values requires
matching on as_str(), not on PartialEq.
Implementations§
Trait Implementations§
Source§impl Clone for QuotaScope
impl Clone for QuotaScope
Source§fn clone(&self) -> QuotaScope
fn clone(&self) -> QuotaScope
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for QuotaScope
impl Debug for QuotaScope
Source§impl<'de> Deserialize<'de> for QuotaScope
impl<'de> Deserialize<'de> for QuotaScope
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Source§impl Display for QuotaScope
impl Display for QuotaScope
impl Eq for QuotaScope
Source§impl PartialEq for QuotaScope
impl PartialEq for QuotaScope
Source§fn eq(&self, other: &QuotaScope) -> bool
fn eq(&self, other: &QuotaScope) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for QuotaScope
impl Serialize for QuotaScope
impl StructuralPartialEq for QuotaScope
Auto Trait Implementations§
impl Freeze for QuotaScope
impl RefUnwindSafe for QuotaScope
impl Send for QuotaScope
impl Sync for QuotaScope
impl Unpin for QuotaScope
impl UnsafeUnpin for QuotaScope
impl UnwindSafe for QuotaScope
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.