pub struct Groups<'a, const N: usize, I: Identifying = NeverIdentifying, S: ScenePurge = NoScenes> { /* private fields */ }Expand description
The Groups cluster’s table.
N is the total across every fabric. §1.3 gives no minimum, but a device type usually
does, and per_fabric is what stops the first ecosystem to commission filling the table
and leaving the second unable to make a single group.
Implementations§
Source§impl<'a, const N: usize, I: Identifying, S: ScenePurge> Groups<'a, N, I, S>
impl<'a, const N: usize, I: Identifying, S: ScenePurge> Groups<'a, N, I, S>
Sourcepub const fn with(
per_fabric: usize,
names: bool,
identifying: &'a I,
scenes: &'a S,
) -> Self
pub const fn with( per_fabric: usize, names: bool, identifying: &'a I, scenes: &'a S, ) -> Self
A table for an endpoint whose Identify cluster identifying reports and whose scenes
live in scenes.
Both are what the rest of the endpoint contributes: §1.3.7.6 makes
AddGroupIfIdentifying conditional on Identify, and §1.3.7.4 makes RemoveGroup
remove that group’s scenes. Pass NeverIdentifying or NoScenes for an endpoint
that has neither — they compile to nothing.
Sourcepub fn conforming(
feature_map: u32,
optional: &Optional<'_>,
) -> Result<Conforming<1, 6, 4, 0>>
pub fn conforming( feature_map: u32, optional: &Optional<'_>, ) -> Result<Conforming<1, 6, 4, 0>>
The descriptor for an instance, derived from the specification’s tables.
Sourcepub fn name_support(&self) -> NameSupportBitmap
pub fn name_support(&self) -> NameSupportBitmap
NameSupport (§1.3.6.1).
“The most significant bit, bit 7 (GroupNames), SHALL be equal to bit 0 of the FeatureMap attribute (GN Feature). All other bits SHALL be 0.” A legacy view of one feature bit, kept in step here so the two cannot disagree.
Sourcepub const fn feature_map(&self) -> u32
pub const fn feature_map(&self) -> u32
The FeatureMap this instance should declare.
Sourcepub fn memberships(&self) -> Ref<'_, Vec<Membership, N>>
pub fn memberships(&self) -> Ref<'_, Vec<Membership, N>>
Every membership, for a device about to persist them.
Sourcepub fn is_member(&self, fabric: FabricIndex, group: GroupId) -> bool
pub fn is_member(&self, fabric: FabricIndex, group: GroupId) -> bool
Whether the endpoint is in a group, on a fabric.
Sourcepub fn len_of_fabric(&self, fabric: FabricIndex) -> usize
pub fn len_of_fabric(&self, fabric: FabricIndex) -> usize
How many groups one fabric holds on this endpoint.
Sourcepub fn capacity(&self, fabric: FabricIndex) -> u8
pub fn capacity(&self, fabric: FabricIndex) -> u8
§1.3.7.9.1’s Capacity: how many more groups this fabric may add.
Sourcepub fn remove_fabric(&self, fabric: FabricIndex)
pub fn remove_fabric(&self, fabric: FabricIndex)
Removes every membership of one fabric — what RemoveFabric must do.
The fabric’s scenes go with them: §1.4.6 says “Upon leaving a fabric with the
RemoveFabric command … all scenes data for the associated fabric SHALL be removed”,
and a group’s scenes outliving the group is the same leak RemoveGroup avoids.
Trait Implementations§
Source§impl<const N: usize, I: Identifying, S: ScenePurge> Cluster for Groups<'_, N, I, S>
So a tuple of clusters can dispatch to it by id.
impl<const N: usize, I: Identifying, S: ScenePurge> Cluster for Groups<'_, N, I, S>
So a tuple of clusters can dispatch to it by id.
Source§impl<const N: usize, I: Identifying, S: ScenePurge> ClusterHandler for Groups<'_, N, I, S>
impl<const N: usize, I: Identifying, S: ScenePurge> ClusterHandler for Groups<'_, N, I, S>
Source§fn on_lifecycle(&self, event: Lifecycle)
fn on_lifecycle(&self, event: Lifecycle)
§1.3: group membership is fabric-scoped, and §1.3.7.4’s rule that a group’s scenes go
with the group applies here too — remove_fabric takes both.
Source§fn read(
&self,
resolved: &Resolved<'_>,
_ctx: &InteractionContext<'_>,
w: &mut TlvWriter<'_>,
tag: Tag,
) -> Result<(), Status>
fn read( &self, resolved: &Resolved<'_>, _ctx: &InteractionContext<'_>, w: &mut TlvWriter<'_>, tag: Tag, ) -> Result<(), Status>
Source§fn invoke(
&self,
resolved: &ResolvedCommand<'_>,
fields: Option<&[u8]>,
ctx: &InteractionContext<'_>,
w: &mut TlvWriter<'_>,
tag: Tag,
) -> Result<Option<CommandId>, StatusIb>
fn invoke( &self, resolved: &ResolvedCommand<'_>, fields: Option<&[u8]>, ctx: &InteractionContext<'_>, w: &mut TlvWriter<'_>, tag: Tag, ) -> Result<Option<CommandId>, StatusIb>
Source§impl<'a, const N: usize, I: Debug + Identifying, S: Debug + ScenePurge> Debug for Groups<'a, N, I, S>
impl<'a, const N: usize, I: Debug + Identifying, S: Debug + ScenePurge> Debug for Groups<'a, N, I, S>
Source§impl<const N: usize, I: Identifying, S: ScenePurge> GroupMembership for Groups<'_, N, I, S>
impl<const N: usize, I: Identifying, S: ScenePurge> GroupMembership for Groups<'_, N, I, S>
Source§fn is_group_member(&self, fabric: FabricIndex, group: GroupId) -> bool
fn is_group_member(&self, fabric: FabricIndex, group: GroupId) -> bool
group on fabric.