#[non_exhaustive]pub enum Datum {
Show 17 variants
Null,
Boolean(bool),
Unsigned(u64),
Signed(i64),
Real(f32),
Double(f64),
NonFinite {
float: String,
},
Text(String),
Octets {
octets: String,
},
Enumerated {
value: u32,
name: Option<String>,
},
Bits {
bits: String,
names: Option<Vec<String>>,
},
Date {
date: String,
},
Time {
time: String,
},
Object {
object_type: String,
type_number: u32,
instance: u32,
},
List(Vec<Datum>),
Constructed {
element: String,
text: String,
fields: Option<Fields>,
},
Raw {
raw: String,
},
}Expand description
A property value as typed data. Serialized untagged, so each form is told apart by its JSON type and keys.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Null
NULL, as null.
Boolean(bool)
A BOOLEAN, as true or false.
Unsigned(u64)
An Unsigned, as a number.
Signed(i64)
A Signed, as a number.
Real(f32)
A REAL, as a number.
Double(f64)
A Double, as a number.
NonFinite
A REAL or Double that is not a number or infinite, which JSON
numbers can’t hold: {"float": "NaN"}.
Text(String)
A CharacterString, as a string.
Octets
An OCTET STRING: {"octets": "0a0b"}, lowercase hex.
Enumerated
An ENUMERATED: {"value": 2, "name": "offnormal"}, without a name
when the property’s enumeration isn’t known.
Bits
A BIT STRING: {"bits": "0100", "names": ["fault"]}, first bit
first. names lists the set bits by name, and is left out when the
property’s bits have no names.
Date
A Date: {"date": "2026-10-19"}, in the text’s form.
Time
A Time: {"time": "07:00"}, in the text’s form.
Object
A BACnetObjectIdentifier: {"type": "analog-input", "type_number": 0, "instance": 1}.
Fields
List(Vec<Datum>)
Several values, or the elements of a list or array, as an array.
Constructed
One constructed element (a timestamp, a schedule day, a recipient):
{"element": "daily-schedule", "text": "Mon 07:00 = active"}. The
element names its kind; the text is for display, not for parsing.
An element decoded field by field (an Event_Parameters value, an
event notification’s values) adds them under fields.
Fields
Raw
Octets that don’t decode: {"raw": "0e0f"}.
Implementations§
Source§impl Datum
impl Datum
Sourcepub fn may_hold_device_text(&self) -> bool
pub fn may_hold_device_text(&self) -> bool
Whether its text may quote a character string a device wrote: a
string, or a constructed element whose kind isn’t in
PLAIN_ELEMENTS or whose fields may. A front end shows such text
as data, never as its own words.