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
source§impl From<&str> for TracedValue
impl From<&str> for TracedValue
source§impl From<bool> for TracedValue
impl From<bool> for TracedValue
source§impl From<f64> for TracedValue
impl From<f64> for TracedValue
source§impl From<i128> for TracedValue
impl From<i128> for TracedValue
source§impl From<i64> for TracedValue
impl From<i64> for TracedValue
source§impl From<u128> for TracedValue
impl From<u128> for TracedValue
source§impl From<u64> for TracedValue
impl From<u64> for TracedValue
source§impl PartialEq<&str> for TracedValue
impl PartialEq<&str> for TracedValue
source§impl PartialEq<TracedValue> for &str
impl PartialEq<TracedValue> for &str
source§fn eq(&self, other: &TracedValue) -> bool
fn eq(&self, other: &TracedValue) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialEq<TracedValue> for bool
impl PartialEq<TracedValue> for bool
source§fn eq(&self, other: &TracedValue) -> bool
fn eq(&self, other: &TracedValue) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialEq<TracedValue> for f64
impl PartialEq<TracedValue> for f64
source§fn eq(&self, other: &TracedValue) -> bool
fn eq(&self, other: &TracedValue) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialEq<TracedValue> for i128
impl PartialEq<TracedValue> for i128
source§fn eq(&self, other: &TracedValue) -> bool
fn eq(&self, other: &TracedValue) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialEq<TracedValue> for i64
impl PartialEq<TracedValue> for i64
source§fn eq(&self, other: &TracedValue) -> bool
fn eq(&self, other: &TracedValue) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialEq<TracedValue> for str
impl PartialEq<TracedValue> for str
source§fn eq(&self, other: &TracedValue) -> bool
fn eq(&self, other: &TracedValue) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialEq<TracedValue> for u128
impl PartialEq<TracedValue> for u128
source§fn eq(&self, other: &TracedValue) -> bool
fn eq(&self, other: &TracedValue) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialEq<TracedValue> for u64
impl PartialEq<TracedValue> for u64
source§fn eq(&self, other: &TracedValue) -> bool
fn eq(&self, other: &TracedValue) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialEq<bool> for TracedValue
impl PartialEq<bool> for TracedValue
source§impl PartialEq<f64> for TracedValue
impl PartialEq<f64> for TracedValue
source§impl PartialEq<i128> for TracedValue
impl PartialEq<i128> for TracedValue
source§impl PartialEq<i64> for TracedValue
impl PartialEq<i64> for TracedValue
source§impl PartialEq<str> for TracedValue
impl PartialEq<str> for TracedValue
source§impl PartialEq<u128> for TracedValue
impl PartialEq<u128> for TracedValue
source§impl PartialEq<u64> for TracedValue
impl PartialEq<u64> for TracedValue
Auto Trait Implementations§
impl RefUnwindSafe for TracedValue
impl Send for TracedValue
impl Sync for TracedValue
impl Unpin for TracedValue
impl UnwindSafe for TracedValue
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