Enum Value
Source pub enum Value {
Null,
Bool(bool),
Int(i64),
Float(f64),
Str(Str),
}
Expand description
The value of a span attribute: a scalar or null.
Strings are bytes, as attribute values copied from requests can be any
bytes.
PHP: string|int|float|bool|null.
use utopia_span::Value;
assert_eq!(Value::from("GET").as_str(), Some("GET"));
assert_eq!(Value::from(200), Value::Int(200));
assert_eq!(Value::from(None::<i64>), Value::Null);
No value. Reading an attribute that is not set returns it too.
The string, when the value is a UTF-8 string.
The bytes, when the value is a string.
The float, when the value is a float.
The integer, when the value is an integer.
The boolean, when the value is a boolean.
The value as PHP prints it: (string) $value (true is 1, false
and null are empty, floats at the precision setting).
The value as a float: (float) $value.
The value in PHP’s value model.
Performs copy-assignment from
source.
Read more
Formats the value using the given formatter.
Read more
Returns the “default value” for a type.
Read more
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from
self to
dest.
Read more
Returns the argument unchanged.
Instruments this type with the provided
Span, returning an
Instrumented wrapper.
Read more
Calls U::from(self).
That is, this conversion is whatever the implementation of
From<T> for U chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more
Uses borrowed data to replace owned data, usually by cloning.
Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.