vector_common/internal_event/optional_tag.rs
1/// The user can configure whether a tag should be emitted. If they configure it to
2/// be emitted, but the value doesn't exist - we should emit the tag but with a value
3/// of `-`.
4#[derive(Clone, Debug, PartialEq, PartialOrd, Eq, Ord, Hash)]
5pub enum OptionalTag<T> {
6 Ignored,
7 Specified(Option<T>),
8}
9
10impl<T> From<Option<T>> for OptionalTag<T> {
11 fn from(value: Option<T>) -> Self {
12 Self::Specified(value)
13 }
14}