#[repr(i8)]pub enum CategoryUnit {
Count = 0,
Bytes = 1,
Milliseconds = 2,
}Expand description
The unit in which a data category is measured.
This enum specifies how quantities for different data categories are measured, which affects how quota limits are interpreted and enforced.
Note: There is no Unknown variant. For categories without a defined unit
(e.g., DataCategory::Unknown), methods return Option::None.
Variants§
Count = 0
Counts the number of discrete items.
Bytes = 1
Counts the number of bytes across items.
Milliseconds = 2
Counts the accumulated time in milliseconds across items.
Implementations§
Source§impl CategoryUnit
impl CategoryUnit
Sourcepub fn from_name(string: &str) -> Option<CategoryUnit>
pub fn from_name(string: &str) -> Option<CategoryUnit>
Returns the category unit corresponding to the given name string.
Returns None if the string doesn’t match any known unit.
Sourcepub fn from_category(category: &DataCategory) -> Option<CategoryUnit>
pub fn from_category(category: &DataCategory) -> Option<CategoryUnit>
Returns the CategoryUnit for the given DataCategory.
Returns None for DataCategory::Unknown.
Note: Takes a reference to avoid unnecessary copying and allow direct use with iterators.
Trait Implementations§
Source§impl Clone for CategoryUnit
impl Clone for CategoryUnit
Source§fn clone(&self) -> CategoryUnit
fn clone(&self) -> CategoryUnit
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CategoryUnit
impl Debug for CategoryUnit
Source§impl<'de> Deserialize<'de> for CategoryUnit
impl<'de> Deserialize<'de> for CategoryUnit
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CategoryUnit, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CategoryUnit, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Display for CategoryUnit
impl Display for CategoryUnit
Source§impl FromStr for CategoryUnit
impl FromStr for CategoryUnit
Source§impl Hash for CategoryUnit
impl Hash for CategoryUnit
Source§impl PartialEq for CategoryUnit
impl PartialEq for CategoryUnit
Source§impl Serialize for CategoryUnit
impl Serialize for CategoryUnit
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,
impl Copy for CategoryUnit
impl Eq for CategoryUnit
impl StructuralPartialEq for CategoryUnit
Auto Trait Implementations§
impl Freeze for CategoryUnit
impl RefUnwindSafe for CategoryUnit
impl Send for CategoryUnit
impl Sync for CategoryUnit
impl Unpin for CategoryUnit
impl UnwindSafe for CategoryUnit
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.