Skip to main content

Module im

Module im 

Source
Expand description

Re-export the rs-matter crate The Interaction Model as defined by the Matter Core spec: the interactions (Read, Subscribe/Report, Write, Invoke, Timed) and their TLV-serde encoding types, plus the engine - InteractionModel - that drives those interactions against a crate::dm data model.

It also contains a requestor-side IM client (client) and a very simple responder - busy - which always returns a busy status code to all incoming IM requests.

Modules§

busy
client
Interaction Model Client implementation.
encoding
The Interaction Model Encoding as defined by the Matter Core spec: the wire-level TLV-serde types and path primitives - request/response payloads (ReadReq, ReportDataReq, WriteReq, InvReq, …), paths (AttrPath, CmdPath, EventPath, GenericPath), status codes and opcodes.
events
expand
Interaction-Model path expansion.
invoker
The Interaction-Model engine’s per-item handler invoker.
subscriptions

Structs§

AttrData
A data response for an attribute in the Interaction Model.
AttrDataArrayBuilder
Array builder for the WriteRequests field. The array is opened in write_requests(); this type provides .push() (start one entry) and .end() (close the array, return to the message builder).
AttrDataBuilder
Streaming builder for a single AttrData entry inside the WriteRequests array.
AttrPath
A path to an attribute in the Interaction Model.
AttrPathArrayBuilder
Array builder for the AttributeRequests field. Opened by ReadReqBuilder::attr_requests; close with .end() to return to the message builder.
AttrPathBuilder
Streaming builder for one AttrPath (AttributePathIB) entry.
AttrStatus
A status response for an attribute in the Interaction Model.
ClusterPath
Cluster Path
CmdData
Data associated with a command invocation.
CmdDataArrayBuilder
Array builder for the InvokeRequests field. Opened by InvReqBuilder::invoke_requests; close with .end() to return to the message builder.
CmdDataBuilder
Streaming builder for one CmdData entry inside the InvokeRequests array.
CmdPath
A path to a command in the Interaction Model.
CmdStatus
Status of a command invocation.
DataVersionFilter
Data Version Filter
DeviceLoad
Resource-utilisation metrics for the node, as reported by GeneralDiagnostics::DeviceLoadStatus.
EventData
A data response for an event in the Interaction Model.
EventFilter
Event Filter
EventPath
Event Path
EventStatus
A status response for an event in the Interaction Model.
GenericPath
A generic (possibly a wildcard) path with endpoint, clusters, and a leaf
InteractionModel
The implementation needs a DataModel instance to interact with the underlying clusters of the data model.
InteractionModelState
An ExchangeHandler implementation capable of handling responder exchanges for the Interaction Model protocol. The mutable, owned-together state a InteractionModel operates on: the subscriptions table, the events queue and the network store.
InvReq
A request to invoke commands in the Interaction Model.
InvReqBuilder
Streaming builder for an InvokeRequestMessage. Type-state-tagged so the compiler enforces in-order field writes.
InvokeResp
A response to an invoke request in the Interaction Model.
ReadReq
A request to read attributes and events from a Matter device.
ReadReqBuilder
Streaming builder for a ReadRequestMessage. Type-state-tagged so the compiler enforces in-order field writes; optional fields are implicitly skipped by not calling their setter.
ReportDataResp
Report Data Message
Status
An IM status structure that contains an IMStatusCode and an optional cluster status code.
StatusResp
An IM status response structure used for sending/receiving status responses in the Interaction Model.
SubscribeReq
A request to subscribe to attributes and events from a Matter device.
SubscribeReqBuilder
Streaming builder for a SubscribeRequestMessage. Type-state-tagged so the compiler enforces in-order field writes; optional fields are implicitly skipped by not calling their setter.
SubscribeResp
A response to a subscription request.
TimedReq
A structure representing a timed request in the Interaction Model.
WriteReq
A request to write attributes to a Matter device.
WriteReqBuilder
Streaming builder for a WriteRequestMessage. Type-state-tagged so the compiler enforces in-order field writes. Optional fields are implicitly skipped by simply not calling their setter — later-field setters are available on all earlier states.
WriteResp
A response to a write request.

Enums§

AttrDataTag
Tags corresponding to the fields in the AttrDataIB TLV structure.
AttrPathTag
Tags corresponding to the fields in the AttributePathIB TLV structure (Matter Core spec). AttrPath is encoded as a TLV list with positional context tags 0..5. Used by callers that need to perform low-level TLV serde on AttrPath data.
AttrResp
Attribute Response
AttrRespTag
Tags corresponding to the fields in the AttributeReportIB TLV structure.
CmdDataTag
Tags corresponding to the fields in the CmdData struct.
CmdPathTag
Tags corresponding to the fields in the CommandPathIB TLV structure (Matter Core spec). CmdPath is encoded as a TLV list with positional context tags 0..2. Used by callers that need to perform low-level TLV serde on CmdPath data.
CmdResp
Response to a command invocation.
CmdRespTag
Tags corresponding to the fields in the CmdResp enum.
EventDataTag
Tags corresponding to the fields in the EventDataIB TLV structure.
EventDataTimestamp
EventPriority
An enum type describing the priority each event might have
EventResp
Event Response
EventRespTag
Tags corresponding to the fields in the EventReportIB TLV structure.
IMStatusCode
An enumeration of all possible error codes that can be returned by the Interaction Model.
InvReqTag
Tags corresponding to the fields in the InvReq struct.
InvRespTag
Tags corresponding to the fields in the InvokeResponseMessage IM struct.
OpCode
An enumeration of all possible opcodes used in the Interaction Model.
ReadReqTag
Tags corresponding to the fields in the ReadReq TLV structure.
ReportDataReq
A wrapper enum for ReadReq and SubscribeReq that allows downstream code to treat the two in a unified manner with regards to OpCode::ReportDataResp type responses.
ReportDataRespTag
Tags corresponding to the fields in the ReportDataMessage TLV structure.
RespondOutcome
SubscribeReqTag
Tags corresponding to the fields in the SubscribeRequestMessage TLV structure (Matter Core spec). Used by the streaming subscribe-request builder and any low-level TLV serde callers.
WriteReqTag
Tags corresponding to the fields in the WriteReq TLV structure.
WriteRespTag
Create a new WriteResp from a TLVElement.

Constants§

FABRIC_INDEX_TAG
TLV context tag for the fabricIndex field of fabric-scoped structs. A Matter global element tag.
IM_REVISION
interactionModelRevision value emitted on every outgoing IM message rs-matter sends — both responder-side (ReportData / WriteResponse / InvokeResponse / StatusResponse / SubscribeResponse, in crate::dm and [status] / [attr::subscribe]) and requestor-side (the client builders in crate::im::client and TimedReq).
IM_REVISION_TAG
TLV context tag for the trailing interactionModelRevision field present on every IM message (carries IM_REVISION). A Matter global element tag.
PROTO_ID_INTERACTION_MODEL
Interaction Model ID as per the Matter Core spec

Traits§

ImStats
Interaction-Model state threaded down to cluster handlers via HandlerContext::im_stats.

Functions§

expand_invoke
Expand (potentially wildcard) invoke requests into concrete command details using the node metadata.
expand_read
Expand (potentially wildcard) read requests into concrete attribute details using the node metadata.
expand_write
Expand (potentially wildcard) write requests into concrete attribute details using the node metadata.

Type Aliases§

ActionId
AmperageMilliA
AttrId
ClusterId
ClusterStatus
CmdId
CommandRef
CompressedFabricId
DataVersion
DeviceTypeId
ElapsedS
EndptId
EnergyMilliVARh
EnergyMilliVAh
EnergyMilliWh
EthInteractionModel
A InteractionModel for an Ethernet device (network store fixed to EthNetwork), so the N generic disappears from call sites. Pairs with EthInteractionModelState.
EthInteractionModelState
A InteractionModelState for an Ethernet device: its network store is a fixed EthNetwork, so call sites need only the (defaulted) subscription/event sizes. Pairs with EthInteractionModel.
EventId
EventNumber
FabricId
FabricIndex
FieldId
IMBuffer
The buffer type used by the Interaction Model for RX/TX payloads. Aliases the central Buffer.
InteractionModelRevision
KeysetId
ListIndex
LocalizedStringIdentifier
Money
NodeId
Percent
Percent100ths
PowerMilliVA
PowerMilliVAR
PowerMilliW
SceneId
SubscriptionId
TransactionId
VoltageMilliV
WirelessInteractionModel
A InteractionModel for a wireless device (network store N, network controller NC). Pairs with WirelessInteractionModelState.
WirelessInteractionModelState
A InteractionModelState for a wireless device, parameterized by the concrete wireless network store N (e.g. WifiNetworks<3> or a Thread store). Pairs with WirelessInteractionModel.