#[non_exhaustive]pub enum QuotaResourceType {
Count,
Octets,
Other(String),
}Expand description
RFC 9425 §3.2 ResourceType — the unit of measure for a quota.
Wire strings: "count", "octets".
Other(String) preserves any unrecognized value for lossless round-trip.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Count
Quota measured in number of data-type objects.
Octets
Quota measured in size (octets / bytes).
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: see QuotaScope::Other for the full
discussion. Constructing
QuotaResourceType::Other("count".into()) produces a value
that is unequal to QuotaResourceType::Count on PartialEq
but serialises to the same wire string and round-trips back
to QuotaResourceType::Count. Reserve Other(s) for
genuinely unrecognised wire strings; compare wire equality
via as_str(), not PartialEq.
Implementations§
Trait Implementations§
Source§impl Clone for QuotaResourceType
impl Clone for QuotaResourceType
Source§fn clone(&self) -> QuotaResourceType
fn clone(&self) -> QuotaResourceType
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 QuotaResourceType
impl Debug for QuotaResourceType
Source§impl<'de> Deserialize<'de> for QuotaResourceType
impl<'de> Deserialize<'de> for QuotaResourceType
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 QuotaResourceType
impl Display for QuotaResourceType
impl Eq for QuotaResourceType
Source§impl PartialEq for QuotaResourceType
impl PartialEq for QuotaResourceType
Source§fn eq(&self, other: &QuotaResourceType) -> bool
fn eq(&self, other: &QuotaResourceType) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for QuotaResourceType
impl Serialize for QuotaResourceType
impl StructuralPartialEq for QuotaResourceType
Auto Trait Implementations§
impl Freeze for QuotaResourceType
impl RefUnwindSafe for QuotaResourceType
impl Send for QuotaResourceType
impl Sync for QuotaResourceType
impl Unpin for QuotaResourceType
impl UnsafeUnpin for QuotaResourceType
impl UnwindSafe for QuotaResourceType
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.