Skip to main content

SceneTable

Struct SceneTable 

Source
pub struct SceneTable<const N: usize, const EFS: usize, const F: usize = 5> { /* private fields */ }
Expand description

The Scene Table (§1.4.7.5), shared by the Scenes Management and Groups clusters.

N is the number of entries across every fabric — §1.4.8.1 sets the minimum at 16 — EFS the bytes one scene’s extension field sets may occupy, and F the fabrics whose SceneInfoStruct is tracked. §1.4.8.2: “The number of list entries for this attribute SHALL NOT exceed the number of supported fabrics by the device.”

Implementations§

Source§

impl<const N: usize, const EFS: usize, const F: usize> SceneTable<N, EFS, F>

Source

pub const fn new(names: bool) -> Self

An empty table. names is the SceneNames feature.

Source

pub const fn size(&self) -> u16

SceneTableSize (§1.4.8.1) — the total across all fabrics.

Source

pub const fn per_fabric(&self) -> usize

§1.4.6’s per-fabric ceiling: “less than half (rounded down towards 0) of the Scene Table entries … with a maximum of 253”.

The point of the rule is that no single fabric can take enough of the table to leave another with nothing, so the bound is half rather than some tuned fraction.

Source

pub fn len_of_fabric(&self, fabric: FabricIndex) -> usize

How many scenes one fabric holds.

Source

pub fn capacity(&self, fabric: FabricIndex) -> u8

§1.4.7.2.5’s RemainingCapacity for one fabric.

Source

pub fn contains(&self, fabric: FabricIndex, group: GroupId, scene: u8) -> bool

Whether a scene exists.

Source

pub fn len(&self) -> usize

How many scenes the table holds in total.

Source

pub fn is_empty(&self) -> bool

Whether the table holds no scenes at all.

Source

pub fn invalidate(&self)

§1.4.7.2.4: an S-quality attribute on this endpoint changed, so no fabric’s CurrentScene describes the endpoint any more.

The device calls this from the cluster that changed — turning a light on by hand invalidates the scene just as surely as recalling a different one does.

Source

pub fn remove_fabric(&self, fabric: FabricIndex)

Removes every scene a fabric owns — what RemoveFabric must do (§1.4.6).

Trait Implementations§

Source§

impl<const N: usize, const EFS: usize, const F: usize> Debug for SceneTable<N, EFS, F>

Source§

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

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

impl<const N: usize, const EFS: usize, const F: usize> ScenePurge for SceneTable<N, EFS, F>

Source§

fn remove_group_scenes(&self, fabric: FabricIndex, group: GroupId)

§1.3.7.4: “scenes associated with the indicated group SHALL be removed”.
Source§

fn remove_grouped_scenes(&self, fabric: FabricIndex)

§1.3.7.5: “all scenes, except for scenes associated with group ID 0, SHALL be removed”.

Auto Trait Implementations§

§

impl<const N: usize, const EFS: usize, const F: usize = 5> !Freeze for SceneTable<N, EFS, F>

§

impl<const N: usize, const EFS: usize, const F: usize = 5> !RefUnwindSafe for SceneTable<N, EFS, F>

§

impl<const N: usize, const EFS: usize, const F: usize = 5> !Sync for SceneTable<N, EFS, F>

§

impl<const N: usize, const EFS: usize, const F: usize> Forget for SceneTable<N, EFS, F>

§

impl<const N: usize, const EFS: usize, const F: usize> Move for SceneTable<N, EFS, F>

§

impl<const N: usize, const EFS: usize, const F: usize> Send for SceneTable<N, EFS, F>
where RefCell<VecInner<Entry<EFS>, usize, VecStorageInner<[MaybeUninit<Entry<EFS>>; N]>>>: Send, RefCell<VecInner<FabricInfo, usize, VecStorageInner<[MaybeUninit<FabricInfo>; F]>>>: Send,

§

impl<const N: usize, const EFS: usize, const F: usize> Unpin for SceneTable<N, EFS, F>
where RefCell<VecInner<Entry<EFS>, usize, VecStorageInner<[MaybeUninit<Entry<EFS>>; N]>>>: Unpin, RefCell<VecInner<FabricInfo, usize, VecStorageInner<[MaybeUninit<FabricInfo>; F]>>>: Unpin,

§

impl<const N: usize, const EFS: usize, const F: usize> UnsafeUnpin for SceneTable<N, EFS, F>
where RefCell<VecInner<Entry<EFS>, usize, VecStorageInner<[MaybeUninit<Entry<EFS>>; N]>>>: UnsafeUnpin, RefCell<VecInner<FabricInfo, usize, VecStorageInner<[MaybeUninit<FabricInfo>; F]>>>: UnsafeUnpin,

§

impl<const N: usize, const EFS: usize, const F: usize> UnwindSafe for SceneTable<N, EFS, F>
where RefCell<VecInner<Entry<EFS>, usize, VecStorageInner<[MaybeUninit<Entry<EFS>>; N]>>>: UnwindSafe, RefCell<VecInner<FabricInfo, usize, VecStorageInner<[MaybeUninit<FabricInfo>; F]>>>: UnwindSafe,

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> 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.