pub struct ScenesState<const N: usize, const M: usize = rs_matter::::dm::clusters::scenes::ScenesState::{constant#0}> { /* private fields */ }Expand description
Caller-owned per-device Scenes state — the scene table plus
per-fabric CurrentScene bookkeeping. Shared across all endpoints
exposing the cluster.
Const generics:
N— total scene-table capacity (rows across all fabrics + endpoints).M— per-scene EFS blob capacity in bytes. Bump it when wiring ColorControl into a multi-feature deployment whose captured EFS exceedsMAX_EXT_FIELDS_LEN. Total static RAM is roughlyN * (M + overhead).
Implementations§
Source§impl<const N: usize, const M: usize> ScenesState<N, M>
impl<const N: usize, const M: usize> ScenesState<N, M>
pub const fn new() -> ScenesState<N, M>
Sourcepub fn init() -> impl Init<ScenesState<N, M>>
pub fn init() -> impl Init<ScenesState<N, M>>
In-place initializer.
Source§impl<const N: usize, const M: usize> ScenesState<N, M>
impl<const N: usize, const M: usize> ScenesState<N, M>
Sourcepub fn load_persist<S>(&self, store: S, buf: &mut [u8]) -> Result<(), Error>where
S: KvBlobStore,
pub fn load_persist<S>(&self, store: S, buf: &mut [u8]) -> Result<(), Error>where
S: KvBlobStore,
Re-hydrate the scene table and per-fabric CurrentScene
bookkeeping from store under SCENES_KEY. A missing key
(first boot or cleared persistence) leaves the registry empty.
Called on startup via the LifecycleOp::Startup lifecycle operation
delivered to the ScenesHandler borrowing this state.
Sourcepub fn reset_persist<S>(&self, store: S, buf: &mut [u8]) -> Result<(), Error>where
S: KvBlobStore,
pub fn reset_persist<S>(&self, store: S, buf: &mut [u8]) -> Result<(), Error>where
S: KvBlobStore,
Reset the scene table and per-fabric CurrentScene bookkeeping to
empty and remove the persisted blob from store (under SCENES_KEY).
Called on factory reset via the LifecycleOp::FactoryReset lifecycle
operation delivered to the ScenesHandler borrowing this state.
Sourcepub fn remove_for_fabric(&self, fab_idx: NonZero<u8>) -> bool
pub fn remove_for_fabric(&self, fab_idx: NonZero<u8>) -> bool
Drop every scene-table row and CurrentScene slot belonging to
fab_idx, returning whether anything was removed.
Called on fabric removal via the LifecycleOp::FabricRemoval
lifecycle operation delivered to the ScenesHandler instance(s)
borrowing this state. Idempotent, since each borrowing handler
instance receives the (broadcast) lifecycle operation.
Trait Implementations§
Source§impl<const N: usize, const M: usize> Default for ScenesState<N, M>
impl<const N: usize, const M: usize> Default for ScenesState<N, M>
Source§fn default() -> ScenesState<N, M>
fn default() -> ScenesState<N, M>
Source§impl<const N: usize, const M: usize> SceneInvalidator for ScenesState<N, M>
impl<const N: usize, const M: usize> SceneInvalidator for ScenesState<N, M>
Source§fn scenable_attribute_changed(&self, endpoint_id: u16)
fn scenable_attribute_changed(&self, endpoint_id: u16)
SceneValid → false for every recalled scene on
endpoint_id, across all fabrics. No-op when no fabric has a
scene recalled there.Auto Trait Implementations§
impl<const N: usize, const M: usize = rs_matter::::dm::clusters::scenes::ScenesState::{constant#0}> !Freeze for ScenesState<N, M>
impl<const N: usize, const M: usize = rs_matter::::dm::clusters::scenes::ScenesState::{constant#0}> !RefUnwindSafe for ScenesState<N, M>
impl<const N: usize, const M: usize = rs_matter::::dm::clusters::scenes::ScenesState::{constant#0}> !Sync for ScenesState<N, M>
impl<const N: usize, const M: usize> Send for ScenesState<N, M>
impl<const N: usize, const M: usize> Unpin for ScenesState<N, M>
impl<const N: usize, const M: usize> UnsafeUnpin for ScenesState<N, M>
impl<const N: usize, const M: usize> UnwindSafe for ScenesState<N, M>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more