pub enum ProblemMetadataValue {
String(Cow<'static, str>),
I64(i64),
U64(u64),
F64(f64),
Bool(bool),
Duration {
secs: u64,
nanos: u32,
},
Ip(IpAddr),
}Expand description
Individual metadata value serialized in problem payloads.
§Examples
use masterror::{ProblemMetadataValue, field};
let (_name, field_value, _redaction) = field::u64("attempt", 2).into_parts();
let value = ProblemMetadataValue::from(field_value);
assert!(matches!(value, ProblemMetadataValue::U64(2)));Variants§
String(Cow<'static, str>)
String value preserved as-is.
I64(i64)
Signed 64-bit integer.
U64(u64)
Unsigned 64-bit integer.
F64(f64)
Floating-point number.
Bool(bool)
Boolean flag serialized as true/false.
Duration
Duration represented as seconds plus nanoseconds remainder.
Fields
Ip(IpAddr)
IP address (v4 or v6).
Trait Implementations§
Source§impl Clone for ProblemMetadataValue
impl Clone for ProblemMetadataValue
Source§fn clone(&self) -> ProblemMetadataValue
fn clone(&self) -> ProblemMetadataValue
Returns a duplicate 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 ProblemMetadataValue
impl Debug for ProblemMetadataValue
Source§impl From<&FieldValue> for ProblemMetadataValue
impl From<&FieldValue> for ProblemMetadataValue
Source§fn from(value: &FieldValue) -> Self
fn from(value: &FieldValue) -> Self
Converts to this type from the input type.
Source§impl From<FieldValue> for ProblemMetadataValue
impl From<FieldValue> for ProblemMetadataValue
Source§fn from(value: FieldValue) -> Self
fn from(value: FieldValue) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ProblemMetadataValue
impl RefUnwindSafe for ProblemMetadataValue
impl Send for ProblemMetadataValue
impl Sync for ProblemMetadataValue
impl Unpin for ProblemMetadataValue
impl UnwindSafe for ProblemMetadataValue
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