Skip to main content

ReportData

Struct ReportData 

Source
#[non_exhaustive]
pub struct ReportData { pub items: Vec<AttributeReportItem>, pub subscription_id: Option<u32>, pub more_chunked_messages: bool, pub suppress_response: bool, pub events: Vec<EventReport>, pub statuses: Vec<(AttributePath, ImStatus)>, }
Expand description

Parsed ReportDataMessage (Matter §10.6.4).

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§items: Vec<AttributeReportItem>

Every AttributeReportIB carrying AttributeData, with the information needed to reassemble chunked and list-chunked reports.

For the common single-message (non-chunked) Replace-only case, prefer the attributes borrowing view over this raw list.

§subscription_id: Option<u32>

Server-assigned subscription identifier, present only in subscription ReportData messages (context tag 0); None in plain ReadResponse messages.

§more_chunked_messages: bool

MoreChunkedMessages (context tag 3): true ⇒ more ReportData chunks follow on this exchange and must be solicited with a StatusResponse. Absent on the wire ⇒ false.

§suppress_response: bool

SuppressResponse (context tag 4): true ⇒ the sender does not expect a StatusResponse for this message. Absent on the wire ⇒ false.

§events: Vec<EventReport>

Every EventReportIB carried in eventReports (context tag 2), in wire order. Empty for attribute-only reports.

§statuses: Vec<(AttributePath, ImStatus)>

Every AttributeStatusIB (a per-path status/error, not attribute data), as (path, status) in wire order. IM-1: these were previously discarded, so a device reporting e.g. UnsupportedAttribute for a requested path was indistinguishable from the path simply being omitted. Populated by parse_report_data; empty for all-data reports and for reports built via ReportData::new. Mirrors the write path, which surfaces per-path status via crate::parse_write_response.

Implementations§

Source§

impl ReportData

Source

pub fn new( items: Vec<AttributeReportItem>, subscription_id: Option<u32>, more_chunked_messages: bool, suppress_response: bool, ) -> Self

Construct a ReportData from its decoded parts.

Provided because the struct is #[non_exhaustive]: callers in other crates cannot use a struct literal, so this constructor is the stable way to build one (e.g. test fixtures that synthesize a report). Any future spec-driven field will gain a default here without breaking existing callers.

Synthesizes an attribute-only report (events empty). Event reports are populated only by parse_report_data; an external caller that needs to synthesize events should construct via the parser from bytes.

Source

pub fn events(&self) -> &[EventReport]

Borrowing view over the event reports carried in this message (eventReports, context tag 2). Empty for attribute-only reports.

Source

pub fn attributes(&self) -> impl Iterator<Item = (&AttributePath, &Value)>

Borrowing (path, value) view over the whole-attribute Replace reports in items, as a flattened convenience for the common single-message (non-chunked) case.

List-append IBs (ListIndex = null, ReportOp::Append) are not included — use items + ReportAccumulator for chunked / list reassembly. AttributeStatus (error) reports never reach items, so they are absent here too.

This borrows from items; it neither allocates nor copies any Value, unlike materializing an owned Vec.

Trait Implementations§

Source§

impl Clone for ReportData

Source§

fn clone(&self) -> ReportData

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 Debug for ReportData

Source§

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

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

impl PartialEq for ReportData

Source§

fn eq(&self, other: &ReportData) -> 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 ReportData

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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.