pub struct AttributePath {
pub enable_tag_compression: bool,
pub node: Option<NodeId>,
pub endpoint: Option<EndpointId>,
pub cluster: Option<ClusterId>,
pub attribute: Option<AttributeId>,
pub list_index: Option<ListIndex>,
pub wildcard_path_flags: Option<WildcardPathFlags>,
pub wildcard_filter_configuration_version: Option<u32>,
}Expand description
AttributePathIB (§10.6.2).
Fields§
§enable_tag_compression: boolEnableTagCompression [0] — provisional, decoded but not resolved.
node: Option<NodeId>Node [1] — “MAY be omitted if the target node of the path matches the NodeID of
the server involved in the interaction”, so None means this node and never
“every node”.
endpoint: Option<EndpointId>Endpoint [2]; None is a wildcard.
cluster: Option<ClusterId>Cluster [3]; None is a wildcard.
attribute: Option<AttributeId>Attribute [4]; None is a wildcard.
list_index: Option<ListIndex>ListIndex [5] — only meaningful when attribute is present.
wildcard_path_flags: Option<WildcardPathFlags>WildcardPathFlags [6] (§10.6.2, defined in §2.13.2), which narrows what a wildcard expands to.
wildcard_filter_configuration_version: Option<u32>WildcardFilterConfigurationVersion [7], added in interaction model revision 13.
Implementations§
Source§impl AttributePath
impl AttributePath
Sourcepub const fn is_valid_for_read(&self) -> bool
pub const fn is_valid_for_read(&self) -> bool
Whether §8.9.2.6’s table admits this path in a Read or Subscribe.
The table lists every legal wildcard combination, and one plausible-looking shape is missing from it: a wildcard cluster with a concrete attribute is allowed only when that attribute is a global one. The row reads “a specific global attribute data or field for all clusters”, and there is no row for a specific non-global attribute across unspecified clusters.
The reason is that attribute ids are only unique within a cluster. 0x0000 is
OnOff on one cluster and CurrentLevel-adjacent on another; asking for “attribute
0x0000 on every cluster” asks for a set of unrelated values that happen to share a
number. Global attributes are the exception because their ids mean the same thing
everywhere, which is what makes them global.
§8.4.3.2 step 1 makes a path the table does not admit a malformed action, so the whole
request is answered INVALID_ACTION rather than the path being given a status.
Sourcepub const fn attribute(
endpoint: EndpointId,
cluster: ClusterId,
attribute: AttributeId,
) -> Self
pub const fn attribute( endpoint: EndpointId, cluster: ClusterId, attribute: AttributeId, ) -> Self
A path naming exactly one attribute.
Sourcepub const fn cluster(endpoint: EndpointId, cluster: ClusterId) -> Self
pub const fn cluster(endpoint: EndpointId, cluster: ClusterId) -> Self
A path naming every attribute of one cluster on one endpoint.
Sourcepub const fn wildcard() -> Self
pub const fn wildcard() -> Self
The path that names everything on the node — §10.6.2.5’s Path = [[ ]].
Sourcepub const fn concrete(&self) -> Option<(EndpointId, ClusterId, AttributeId)>
pub const fn concrete(&self) -> Option<(EndpointId, ClusterId, AttributeId)>
The endpoint, cluster and attribute, if the path names exactly one of each.
None when any of the three is wildcarded — which a server must expand rather than
reject, so this is a question and not a validation.
Sourcepub const fn has_wildcard(&self) -> bool
pub const fn has_wildcard(&self) -> bool
Whether any field is wildcarded.
Sourcepub fn encode(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()>
pub fn encode(&self, w: &mut TlvWriter<'_>, tag: Tag) -> Result<()>
Writes the path as a List under tag.
§10.6.1: “all context tags SHALL be emitted in the order as defined in the appropriate specification. This is done to reduce receiver side complexity in having to deal with arbitrary order tags.” So the order here is the schema’s, not a choice.
Sourcepub fn decode(reader: &mut TlvReader<'_>) -> Result<Self>
pub fn decode(reader: &mut TlvReader<'_>) -> Result<Self>
Reads a path whose opening List element the caller has just taken.
Sourcepub fn from_element(
reader: &mut TlvReader<'_>,
element: &Element<'_>,
) -> Result<Self>
pub fn from_element( reader: &mut TlvReader<'_>, element: &Element<'_>, ) -> Result<Self>
Reads a path from an element that should open a List.