#[non_exhaustive]pub enum AttributeValue {
String(String),
Bool(bool),
I64(i64),
F64(f64),
StringArray(Vec<String>),
BoolArray(Vec<bool>),
I64Array(Vec<i64>),
F64Array(Vec<f64>),
}Expand description
The value of a span attribute (OpenTelemetry AttributeValue): a string, number or boolean,
or a homogeneous array of them.
use strands::telemetry::AttributeValue;
assert_eq!(AttributeValue::from("sess-1"), AttributeValue::String("sess-1".into()));
assert_eq!(AttributeValue::from(3), AttributeValue::I64(3));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
String(String)
A string.
Bool(bool)
A boolean.
I64(i64)
An integer.
F64(f64)
A floating point number.
StringArray(Vec<String>)
An array of strings.
BoolArray(Vec<bool>)
An array of booleans.
I64Array(Vec<i64>)
An array of integers.
F64Array(Vec<f64>)
An array of floating point numbers.
Trait Implementations§
Source§impl Clone for AttributeValue
impl Clone for AttributeValue
Source§impl Debug for AttributeValue
impl Debug for AttributeValue
Source§impl From<&String> for AttributeValue
impl From<&String> for AttributeValue
Source§impl From<&str> for AttributeValue
impl From<&str> for AttributeValue
Source§impl From<AttributeValue> for Value
Available on crate feature otel only.
impl From<AttributeValue> for Value
Available on crate feature
otel only.Source§fn from(value: AttributeValue) -> Self
fn from(value: AttributeValue) -> Self
Converts to this type from the input type.
Source§impl From<String> for AttributeValue
impl From<String> for AttributeValue
Source§impl From<bool> for AttributeValue
impl From<bool> for AttributeValue
Source§impl From<f64> for AttributeValue
impl From<f64> for AttributeValue
Source§impl From<i32> for AttributeValue
impl From<i32> for AttributeValue
Source§impl From<i64> for AttributeValue
impl From<i64> for AttributeValue
Source§impl From<u32> for AttributeValue
impl From<u32> for AttributeValue
Source§impl From<u64> for AttributeValue
impl From<u64> for AttributeValue
Source§impl PartialEq for AttributeValue
impl PartialEq for AttributeValue
impl StructuralPartialEq for AttributeValue
Auto Trait Implementations§
impl Freeze for AttributeValue
impl RefUnwindSafe for AttributeValue
impl Send for AttributeValue
impl Sync for AttributeValue
impl Unpin for AttributeValue
impl UnsafeUnpin for AttributeValue
impl UnwindSafe for AttributeValue
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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> ⓘ
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> ⓘ
Converts
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> ⓘ
Converts
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 moreCreates a shared type from an unshared type.