pub enum Reading<T> {
Value(T),
NotOperational,
Unsupported,
}Expand description
What a driver can say about a diagnostics attribute whose null means something.
The three network diagnostics clusters — ethernet_network_diagnostics,
wi_fi_network_diagnostics and thread_network_diagnostics — all have attributes that
are both optional and nullable, and the specification gives the two states different
meanings: null is “the interface is not currently configured or operational”, and leaving
the attribute out of AttributeList is “this device does not report it”. Option<Option<T>>
would say both and say neither clearly, so a driver returns this and names the three answers:
Reading::Value— measured, and this is it.Reading::NotOperational— measurable, but not right now; the specification’snull.Reading::Unsupported— not implemented on this device, so it must not appear inAttributeListeither.
An attribute that is mandatory and nullable has only two of those answers, and its driver
method returns Option instead — a type that cannot say “unsupported” about an attribute
the specification requires.
Variants§
Value(T)
A measured value.
NotOperational
null: the interface is not configured or operational.
Unsupported
The attribute is not implemented by this device.