Enum AnyValue
#[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§
§impl From<StringValue> for AnyValue
impl From<StringValue> for AnyValue
§fn from(val: StringValue) -> AnyValue
fn from(val: StringValue) -> AnyValue
§impl<K, V> FromIterator<(K, V)> for AnyValue
impl<K, V> FromIterator<(K, V)> for AnyValue
§fn from_iter<I>(iter: I) -> AnyValuewhere
I: IntoIterator<Item = (K, V)>,
fn from_iter<I>(iter: I) -> AnyValuewhere
I: IntoIterator<Item = (K, V)>,
Creates an AnyValue::Map value from a sequence of key-value pairs
that can be converted into a Key and AnyValue respectively.
§impl<T> FromIterator<T> for AnyValue
impl<T> FromIterator<T> for AnyValue
§fn from_iter<I>(iter: I) -> AnyValuewhere
I: IntoIterator<Item = T>,
fn from_iter<I>(iter: I) -> AnyValuewhere
I: IntoIterator<Item = T>,
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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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<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> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more