pub enum TaskValue {
Null,
Bool(bool),
Int(i64),
UInt(u64),
Float(f64),
String(String),
Bytes(Vec<u8>),
Array(Vec<TaskValue>),
Object(Vec<(String, TaskValue)>),
}Expand description
A JSON-like value used to represent a single task argument.
This intentionally mirrors the shape of a serialized argument (the kind of
thing you would get from serde_json::Value) while keeping integer and
byte information that JSON would lose. It is the common currency of the
security modules: signatures canonicalize it, the sanitizer cleans it, and
the PII detector scans the strings inside it.
Variants§
Null
Absence of a value (null).
Bool(bool)
Boolean.
Int(i64)
Signed 64-bit integer.
UInt(u64)
Unsigned 64-bit integer (for values exceeding i64::MAX).
Float(f64)
64-bit floating point.
String(String)
UTF-8 string.
Bytes(Vec<u8>)
Raw bytes (binary blob).
Array(Vec<TaskValue>)
Ordered list of values.
Object(Vec<(String, TaskValue)>)
Ordered key/value map. Kept as a Vec of pairs so insertion order is
preserved for display; canonicalization and lookups sort by key.
Implementations§
Source§impl TaskValue
impl TaskValue
Sourcepub fn as_str(&self) -> Option<&str>
pub fn as_str(&self) -> Option<&str>
Borrow the inner string, if this is a TaskValue::String.
Sourcepub fn approx_size(&self) -> usize
pub fn approx_size(&self) -> usize
Approximate in-memory “weight” of this value in bytes, used for size limiting. Containers sum their children plus a small per-element overhead so deeply nested structures are accounted for.