#[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§impl PartialEq<TracedValue> for bool
impl PartialEq<TracedValue> for bool
Source§impl PartialEq<TracedValue> for f64
impl PartialEq<TracedValue> for f64
Source§impl PartialEq<TracedValue> for i128
impl PartialEq<TracedValue> for i128
Source§impl PartialEq<TracedValue> for i64
impl PartialEq<TracedValue> for i64
Source§impl PartialEq<TracedValue> for str
impl PartialEq<TracedValue> for str
Source§impl PartialEq<TracedValue> for u128
impl PartialEq<TracedValue> for u128
Source§impl PartialEq<TracedValue> for u64
impl PartialEq<TracedValue> for u64
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 Freeze for TracedValue
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
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)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)