#[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
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: boolMoreChunkedMessages (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: boolSuppressResponse (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
impl ReportData
Sourcepub fn new(
items: Vec<AttributeReportItem>,
subscription_id: Option<u32>,
more_chunked_messages: bool,
suppress_response: bool,
) -> Self
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.
Sourcepub fn events(&self) -> &[EventReport]
pub fn events(&self) -> &[EventReport]
Borrowing view over the event reports carried in this message
(eventReports, context tag 2). Empty for attribute-only reports.
Sourcepub fn attributes(&self) -> impl Iterator<Item = (&AttributePath, &Value)>
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
impl Clone for ReportData
Source§fn clone(&self) -> ReportData
fn clone(&self) -> ReportData
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more