Skip to main content

Config

Trait Config 

Source
pub trait Config {
    const FABRICS: usize = 5;
    const SUBSCRIPTIONS_PER_FABRIC: usize = 3;
    const ACL_ENTRIES_PER_FABRIC: usize = 4;
    const GROUPS_PER_FABRIC: usize = 4;
    const GROUP_KEYS_PER_FABRIC: usize = 3;
    const READ_PATHS: usize = 9;
    const ICD_CLIENTS_PER_FABRIC: usize = 1;
    const ACL_AUXILIARY: bool = false;
}
Expand description

What a Matter node promises each fabric, and which optional behaviours it serves.

Implement this on a zero-sized type and pass it as the C parameter. Every constant has a default that is the specification’s own minimum, so impl Config for MyNode {} is a complete and conformant implementation.

It does not size anything: see the module documentation.

Provided Associated Constants§

Source

const FABRICS: usize = 5

How many fabrics — commissioned ecosystems — the node can belong to.

Reported as SupportedFabrics (Core §11.18.5.3), whose constraint is 5 to 254: a node that supports fewer than five cannot be commissioned into the number of ecosystems the specification requires. The fabric table is asserted at compile time to hold this many.

Source

const SUBSCRIPTIONS_PER_FABRIC: usize = 3

How many subscriptions any one fabric may hold.

§2.11.2.2 states the rule as a guarantee, not a cap: “A publisher SHALL ensure that every fabric the node is commissioned into can support at least three Subscribe Interactions to the publisher.” A table with only a global limit cannot make that promise — the first administrator to ask fills it, and every fabric commissioned afterwards is told the node is out of resources by a node that is, from its own point of view, working perfectly.

So the guarantee is a fixed share each, refusing a fabric that is at its quota even when the table has room. That is the strict reading, it is always conformant, and it cannot surprise an administrator by granting a subscription one day and refusing it the next when what changed was somebody else’s fabric.

Source

const ACL_ENTRIES_PER_FABRIC: usize = 4

How many access-control entries one fabric may hold — §9.10.6.7’s AccessControlEntriesPerFabric, constrained to 4 to 65534.

§2.11.1.1 requires “at least four Access Control Entries available for every fabric supported by the node”, and without a quota the first fabric to fill the table would lock every later administrator out of granting itself anything.

§2.11.1.1 permits over-subscription — “if it supports N entries must enforce that any K fabrics together do not use more than N - 4*(5-K) entries” — which would let one fabric borrow the unused quota of another. This is the strict reading instead: a fixed share each, for the same reason as SUBSCRIPTIONS_PER_FABRIC.

Source

const GROUPS_PER_FABRIC: usize = 4

How many group memberships one fabric may hold — §11.2.6.2’s MaxGroupsPerFabric.

Core §2.11.1.2: “at least four groups per fabric”.

Source

const GROUP_KEYS_PER_FABRIC: usize = 3

How many group key sets one fabric may hold — §11.2.6.3’s MaxGroupKeysPerFabric.

Core §2.11.1.2: “at least three group keys per fabric”.

Source

const READ_PATHS: usize = 9

How many paths one Read Request is guaranteed to be answered with.

§11.1.4.4’s ReadPathsSupported, constrained to 9 to 10000: “the actual maximum number of read paths … which a node guarantees being able to process in any Read Request Action”. Core §2.11.2.1 sets the floor: “a single Read Interaction from a client on that fabric containing up to 9 paths”.

Unlike every other constant here this one is a promise about work rather than about storage, so no table can check it. tests/im_read_server.rs does, by reading that many paths in one action and requiring an answer.

Source

const ICD_CLIENTS_PER_FABRIC: usize = 1

How many Check-In registrations one fabric may hold — §9.16.6.6’s ClientsSupportedPerFabric, constrained to min 1.

§9.16.6.5: “The maximum number of entries that can be in the list SHALL be ClientsSupportedPerFabric for each fabric”, so this is a per-fabric guarantee like the others and the registration table is checked against it at compile time.

Source

const ACL_AUXILIARY: bool = false

Whether §9.10.4.3’s Auxiliary feature is implemented.

It changes an access decision: with it, §6.6.6.2 stops a wildcard Group entry from reaching endpoint 0, whose clusters administer the node itself.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§