Enum opentelemetry::logs::AnyValue
source · #[non_exhaustive]pub enum AnyValue {
Int(i64),
Double(f64),
String(StringValue),
Boolean(bool),
Bytes(Box<Vec<u8>>),
ListAny(Box<Vec<AnyValue>>),
Map(Box<HashMap<Key, AnyValue>>),
}
Expand description
Value types for representing arbitrary values in a log record.
Note: The tracing
and log
crates only support basic types that can be
converted to these core variants: i64
, f64
, StringValue
, and bool
.
Any complex and custom types are supported through their Debug implementation,
and converted to String. More complex types (Bytes
, ListAny
, and Map
) are
included here to meet specification requirements and are available to support
custom appenders that may be implemented for other logging crates.
These types allow for handling dynamic data structures, so keep in mind the
potential performance overhead of using boxed vectors and maps in appenders.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Int(i64)
An integer value
Double(f64)
A double value
String(StringValue)
A string value
Boolean(bool)
A boolean value
Bytes(Box<Vec<u8>>)
A byte array
ListAny(Box<Vec<AnyValue>>)
An array of Any
values
Map(Box<HashMap<Key, AnyValue>>)
A map of string keys to Any
values, arbitrarily nested.
Trait Implementations§
source§impl From<StringValue> for AnyValue
impl From<StringValue> for AnyValue
source§fn from(val: StringValue) -> AnyValue
fn from(val: StringValue) -> AnyValue
source§impl<K: Into<Key>, V: Into<AnyValue>> FromIterator<(K, V)> for AnyValue
impl<K: Into<Key>, V: Into<AnyValue>> FromIterator<(K, V)> for AnyValue
source§fn from_iter<I: IntoIterator<Item = (K, V)>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = (K, V)>>(iter: I) -> Self
Creates an AnyValue::Map
value from a sequence of key-value pairs
that can be converted into a Key
and AnyValue
respectively.
source§impl<T: Into<AnyValue>> FromIterator<T> for AnyValue
impl<T: Into<AnyValue>> FromIterator<T> for AnyValue
source§fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Creates an AnyValue::ListAny
value from a sequence of Into<AnyValue>
values.
impl StructuralPartialEq for AnyValue
Auto Trait Implementations§
impl Freeze for AnyValue
impl RefUnwindSafe for AnyValue
impl Send for AnyValue
impl Sync for AnyValue
impl Unpin for AnyValue
impl UnwindSafe for AnyValue
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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)