Enum tracing_tunnel::TracedValue
source · #[non_exhaustive]
pub enum TracedValue {
Bool(bool),
Int(i128),
UInt(u128),
Float(f64),
String(String),
Object(DebugObject),
Error(TracedError),
}
Expand description
Value recorded in a tracing span or event.
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.
Bool(bool)
Boolean value.
Int(i128)
Signed integer value.
UInt(u128)
Unsigned integer value.
Float(f64)
Floating-point value.
String(String)
String value.
Object(DebugObject)
Opaque object implementing the Debug
trait.
Error(TracedError)
Available on crate feature
std
only.Opaque error.
Implementations§
source§impl TracedValue
impl TracedValue
sourcepub fn as_bool(&self) -> Option<bool>
pub fn as_bool(&self) -> Option<bool>
Returns value as a Boolean, or None
if it’s not a Boolean value.
sourcepub fn as_int(&self) -> Option<i128>
pub fn as_int(&self) -> Option<i128>
Returns value as a signed integer, or None
if it’s not one.
sourcepub fn as_uint(&self) -> Option<u128>
pub fn as_uint(&self) -> Option<u128>
Returns value as an unsigned integer, or None
if it’s not one.
sourcepub fn as_float(&self) -> Option<f64>
pub fn as_float(&self) -> Option<f64>
Returns value as a floating-point value, or None
if it’s not one.
sourcepub fn is_debug(&self, object: &dyn Debug) -> bool
pub fn is_debug(&self, object: &dyn Debug) -> bool
Checks whether this value is a DebugObject
with the same Debug
output as the provided object
.
sourcepub fn as_debug_str(&self) -> Option<&str>
pub fn as_debug_str(&self) -> Option<&str>
Returns value as a Debug
string output, or None
if this value
is not Self::Object
.
Trait Implementations§
source§impl Clone for TracedValue
impl Clone for TracedValue
source§fn clone(&self) -> TracedValue
fn clone(&self) -> TracedValue
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for TracedValue
impl Debug for TracedValue
source§impl<'de> Deserialize<'de> for TracedValue
impl<'de> Deserialize<'de> for TracedValue
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more