pub enum Condition {
Always,
Feature(u8),
Attribute(AttributeId),
Command(CommandId),
Event(EventId),
Cluster(ClusterId),
Named(&'static str),
Not(&'static Condition),
All(&'static [Condition]),
Any(&'static [Condition]),
ExactlyOne(&'static [Condition]),
}Expand description
What an element’s presence depends on.
Borrowed rather than owned throughout: the whole tree is const data generated from the
CSA XML, so a condition is a &'static Condition and costs nothing at runtime.
Variants§
Always
Unconditional.
Feature(u8)
A feature bit of this cluster’s FeatureMap.
Attribute(AttributeId)
Another attribute of this cluster being present.
Command(CommandId)
A command of this cluster being present.
Event(EventId)
An event of this cluster being present.
Cluster(ClusterId)
Another cluster on the same endpoint — how a device type says “Level Control, if you have On/Off”.
Named(&'static str)
A named condition the XML does not define in terms of anything else — “Zigbee”,
“Matter”, “LargeMessageTransport”. A validator cannot evaluate these, so an element
that depends on one is Conformance::Described rather than guessed at.
Not(&'static Condition)
Logical negation.
All(&'static [Condition])
Every term must hold.
Any(&'static [Condition])
Some term must hold.
ExactlyOne(&'static [Condition])
Exactly one term must hold. Rare, and the reason Any cannot simply be reused.