pub struct KeyValue<'a> {
pub key: StringType<'a>,
pub value: Value<'a>,
}Expand description
A key-value attribute pair used in telemetry data.
Key-value pairs provide additional context for spans, events, and log messages. The key is typically a string identifier, and the value can be one of several supported data types.
§Examples
use veecle_telemetry::types::StringType;
use veecle_telemetry::{KeyValue, Value};
// Create attributes with different value types
let user_id = KeyValue::new("user_id", 123);
let username = KeyValue::new("username", "alice");
let is_active = KeyValue::new("is_active", true);
let score = KeyValue::new("score", 95.5);Fields§
§key: StringType<'a>The attribute key (name)
value: Value<'a>The attribute value
Implementations§
Trait Implementations§
Source§impl<'de: 'a, 'a> Deserialize<'de> for KeyValue<'a>
impl<'de: 'a, 'a> Deserialize<'de> for KeyValue<'a>
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
Auto Trait Implementations§
impl<'a> Freeze for KeyValue<'a>
impl<'a> RefUnwindSafe for KeyValue<'a>
impl<'a> Send for KeyValue<'a>
impl<'a> Sync for KeyValue<'a>
impl<'a> Unpin for KeyValue<'a>
impl<'a> UnwindSafe for KeyValue<'a>
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