Enum vector_lib::event::metric::TagValueSet
pub enum TagValueSet {
Empty,
Single(TagValue),
Set(IndexSet<TagValue>),
}
Expand description
Tag values for a metric series. This may be empty, a single value, or a set of values. This is
used to provide the storage for TagValueSet
.
Variants§
Empty
This represents a set containing no value.
Single(TagValue)
This represents a set containing a single value. This is stored separately to avoid the overhead of allocating a hash table for the common case of a single value for a tag.
Set(IndexSet<TagValue>)
This holds an actual set of values. This variant will be automatically created when a single value is added to, and reduced down to a single value when the length is reduced to 1. An index set is used for this set, as it preserves the insertion order of the contained elements. This allows us to retrieve the last element inserted which in turn allows us to emulate the set having a single value.
Implementations§
§impl TagValueSet
impl TagValueSet
pub fn into_single(self) -> Option<String>
pub fn into_single(self) -> Option<String>
Convert this set into a single value, mimicking the behavior of this set being just a plain single string while still storing all of the values.
pub fn as_single(&self) -> Option<&str>
pub fn as_single(&self) -> Option<&str>
Get the “single” value of this set, mimicking the behavior of this set being just a plain single string while still storing all of the values.
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
pub fn iter(&self) -> TagValueRefIter<'_> ⓘ
Trait Implementations§
§impl ByteSizeOf for TagValueSet
impl ByteSizeOf for TagValueSet
§impl Clone for TagValueSet
impl Clone for TagValueSet
§fn clone(&self) -> TagValueSet
fn clone(&self) -> TagValueSet
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Configurable for TagValueSet
impl Configurable for TagValueSet
§fn referenceable_name() -> Option<&'static str>
fn referenceable_name() -> Option<&'static str>
§fn generate_schema(
schema_gen: &RefCell<SchemaGenerator>,
) -> Result<SchemaObject, GenerateError>
fn generate_schema( schema_gen: &RefCell<SchemaGenerator>, ) -> Result<SchemaObject, GenerateError>
§fn is_optional() -> boolwhere
Self: Sized,
fn is_optional() -> boolwhere
Self: Sized,
§fn validate_metadata(_metadata: &Metadata) -> Result<(), GenerateError>where
Self: Sized,
fn validate_metadata(_metadata: &Metadata) -> Result<(), GenerateError>where
Self: Sized,
§fn as_configurable_ref() -> ConfigurableRefwhere
Self: Sized + 'static,
fn as_configurable_ref() -> ConfigurableRefwhere
Self: Sized + 'static,
§impl Debug for TagValueSet
impl Debug for TagValueSet
§impl Default for TagValueSet
impl Default for TagValueSet
§fn default() -> TagValueSet
fn default() -> TagValueSet
§impl<'de> Deserialize<'de> for TagValueSet
impl<'de> Deserialize<'de> for TagValueSet
§fn deserialize<D>(de: D) -> Result<TagValueSet, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(de: D) -> Result<TagValueSet, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
§impl Display for TagValueSet
impl Display for TagValueSet
§impl<const N: usize> From<[String; N]> for TagValueSet
impl<const N: usize> From<[String; N]> for TagValueSet
§fn from(values: [String; N]) -> TagValueSet
fn from(values: [String; N]) -> TagValueSet
§impl<const N: usize> From<[TagValue; N]> for TagValueSet
impl<const N: usize> From<[TagValue; N]> for TagValueSet
§fn from(values: [TagValue; N]) -> TagValueSet
fn from(values: [TagValue; N]) -> TagValueSet
§impl From<Vec<String>> for TagValueSet
impl From<Vec<String>> for TagValueSet
§fn from(values: Vec<String>) -> TagValueSet
fn from(values: Vec<String>) -> TagValueSet
§impl From<Vec<TagValue>> for TagValueSet
impl From<Vec<TagValue>> for TagValueSet
§fn from(values: Vec<TagValue>) -> TagValueSet
fn from(values: Vec<TagValue>) -> TagValueSet
§impl FromIterator<String> for TagValueSet
impl FromIterator<String> for TagValueSet
§fn from_iter<T>(values: T) -> TagValueSetwhere
T: IntoIterator<Item = String>,
fn from_iter<T>(values: T) -> TagValueSetwhere
T: IntoIterator<Item = String>,
§impl FromIterator<TagValue> for TagValueSet
impl FromIterator<TagValue> for TagValueSet
§fn from_iter<T>(values: T) -> TagValueSetwhere
T: IntoIterator<Item = TagValue>,
fn from_iter<T>(values: T) -> TagValueSetwhere
T: IntoIterator<Item = TagValue>,
§impl FromLua for TagValueSet
impl FromLua for TagValueSet
§fn from_lua(value: Value, _: &Lua) -> Result<TagValueSet, Error>
fn from_lua(value: Value, _: &Lua) -> Result<TagValueSet, Error>
§impl Hash for TagValueSet
impl Hash for TagValueSet
§impl<'a> IntoIterator for &'a TagValueSet
impl<'a> IntoIterator for &'a TagValueSet
§type IntoIter = TagValueRefIter<'a>
type IntoIter = TagValueRefIter<'a>
§fn into_iter(self) -> <&'a TagValueSet as IntoIterator>::IntoIter
fn into_iter(self) -> <&'a TagValueSet as IntoIterator>::IntoIter
§impl IntoIterator for TagValueSet
impl IntoIterator for TagValueSet
§type IntoIter = TagValueIntoIter
type IntoIter = TagValueIntoIter
§fn into_iter(self) -> <TagValueSet as IntoIterator>::IntoIter
fn into_iter(self) -> <TagValueSet as IntoIterator>::IntoIter
§impl Ord for TagValueSet
impl Ord for TagValueSet
§impl PartialEq for TagValueSet
impl PartialEq for TagValueSet
§fn eq(&self, other: &TagValueSet) -> bool
fn eq(&self, other: &TagValueSet) -> bool
self
and other
values to be equal, and is used
by ==
.§impl PartialOrd for TagValueSet
impl PartialOrd for TagValueSet
§fn partial_cmp(&self, that: &TagValueSet) -> Option<Ordering>
fn partial_cmp(&self, that: &TagValueSet) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more§impl Serialize for TagValueSet
impl Serialize for TagValueSet
§fn serialize<S>(
&self,
ser: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
ser: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
§impl ToValue for TagValueSet
impl ToValue for TagValueSet
impl Eq for TagValueSet
impl StructuralPartialEq for TagValueSet
Auto Trait Implementations§
impl Freeze for TagValueSet
impl RefUnwindSafe for TagValueSet
impl Send for TagValueSet
impl Sync for TagValueSet
impl Unpin for TagValueSet
impl UnwindSafe for TagValueSet
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
§impl<T> CallHasher for T
impl<T> CallHasher for T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
§fn deserialize(
&self,
deserializer: &mut D,
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>
§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.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§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
§impl<T> FromLuaMulti for Twhere
T: FromLua,
impl<T> FromLuaMulti for Twhere
T: FromLua,
§fn from_lua_multi(values: MultiValue, lua: &Lua) -> Result<T, Error>
fn from_lua_multi(values: MultiValue, lua: &Lua) -> Result<T, Error>
fn from_lua_args( args: MultiValue, i: usize, to: Option<&str>, lua: &Lua, ) -> Result<T, Error>
unsafe fn from_stack_multi(nvals: i32, lua: &RawLua) -> Result<T, Error>
unsafe fn from_stack_args( nargs: i32, i: usize, to: Option<&str>, lua: &RawLua, ) -> Result<T, Error>
§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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
§impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
type Error = <Target as OctetsFrom<Source>>::Error
§fn try_octets_into(
self,
) -> Result<Target, <Source as OctetsInto<Target>>::Error>
fn try_octets_into( self, ) -> Result<Target, <Source as OctetsInto<Target>>::Error>
§fn octets_into(self) -> Targetwhere
Self::Error: Into<Infallible>,
fn octets_into(self) -> Targetwhere
Self::Error: Into<Infallible>,
§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
§fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
§fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
§fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
§fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
§fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
§fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
§fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
§fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
§fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
§fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
§fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
§fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
§fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
§fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
§fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
§fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
§fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
§fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
§fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg
or
a color-specific method, such as OwoColorize::green
, Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg
or
a color-specific method, such as OwoColorize::on_yellow
, Read more