Module value
Expand description
Key-value attribute types for telemetry data.
This module defines the types used to represent attributes in telemetry data. Attributes are key-value pairs that provide additional context for spans, events, and log messages.
§Value Types
The Value
enum supports common data types:
- String: Text values (adapted to platform string type)
- Bool: Boolean values (true/false)
- I64: 64-bit signed integers
- F64: 64-bit floating-point numbers
§Examples
use veecle_telemetry::types::StringType;
use veecle_telemetry::{KeyValue, Value};
// Create key-value pairs
let user_id = KeyValue::new("user_id", 123);
let username = KeyValue::new("username", "alice");
let is_admin = KeyValue::new("is_admin", true);
let score = KeyValue::new("score", 95.5);
// Values can be created from various types
let string_value = Value::String("hello".into());
let int_value = Value::I64(42);
let bool_value = Value::Bool(true);
let float_value = Value::F64(3.14);
Structs§
- KeyValue
- A key-value attribute pair used in telemetry data.
Enums§
- Value
- A value that can be stored in a telemetry attribute.