Skip to main content

AttributePath

Struct AttributePath 

Source
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: bool

EnableTagCompression [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

Source

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.

Source

pub const fn attribute( endpoint: EndpointId, cluster: ClusterId, attribute: AttributeId, ) -> Self

A path naming exactly one attribute.

Source

pub const fn cluster(endpoint: EndpointId, cluster: ClusterId) -> Self

A path naming every attribute of one cluster on one endpoint.

Source

pub const fn wildcard() -> Self

The path that names everything on the node — §10.6.2.5’s Path = [[ ]].

Source

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.

Source

pub const fn has_wildcard(&self) -> bool

Whether any field is wildcarded.

Source

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.

Source

pub fn decode(reader: &mut TlvReader<'_>) -> Result<Self>

Reads a path whose opening List element the caller has just taken.

Source

pub fn from_element( reader: &mut TlvReader<'_>, element: &Element<'_>, ) -> Result<Self>

Reads a path from an element that should open a List.

Trait Implementations§

Source§

impl Clone for AttributePath

Source§

fn clone(&self) -> AttributePath

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for AttributePath

Source§

impl Debug for AttributePath

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for AttributePath

Source§

fn default() -> AttributePath

Returns the “default value” for a type. Read more
Source§

impl Eq for AttributePath

Source§

impl PartialEq for AttributePath

Source§

fn eq(&self, other: &AttributePath) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for AttributePath

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.