pub struct Subscriptions<const N: usize = rs_matter::::im::subscriptions::Subscriptions::{constant#0}> { /* private fields */ }Expand description
A type for tracking subscriptions accepted by the data model.
The N type parameter specifies the maximum number of subscriptions that can be tracked at the same time.
Additional subscriptions are rejected by the data model with a “resource exhausted” IM status message.
Implementations§
Source§impl<const N: usize> Subscriptions<N>
impl<const N: usize> Subscriptions<N>
Sourcepub const fn new() -> Subscriptions<N>
pub const fn new() -> Subscriptions<N>
Create the instance.
Sourcepub fn init() -> impl Init<Subscriptions<N>>
pub fn init() -> impl Init<Subscriptions<N>>
Create an in-place initializer for the instance.
Sourcepub const fn persist_enabled(&self) -> bool
pub const fn persist_enabled(&self) -> bool
Whether subscription persistence is compiled in.
true only when the persistent-subscriptions feature is enabled; when it
is off, the persist/resume machinery is compiled out entirely and this is a
const false that lets the linker drop the callers.
Sourcepub fn has_subscription_for(&self, fab_idx: NonZero<u8>, node_id: u64) -> bool
pub fn has_subscription_for(&self, fab_idx: NonZero<u8>, node_id: u64) -> bool
Whether a live subscription exists on fab_idx whose subscriber node
matches node_id.
This is the ICD “is this client subscribed?” predicate that decides
whether a registered client is nudged with a Check-In. Persisted
subscriptions are re-hydrated into this same table at startup
(resume_subscriptions), so a resumed subscription counts here too — no
separate “persisted subscription” lookup is needed.
Sourcepub fn load_stats(&self, fab_idx: Option<NonZero<u8>>) -> DeviceLoad
pub fn load_stats(&self, fab_idx: Option<NonZero<u8>>) -> DeviceLoad
A consistent snapshot of the subscription-related figures of
GeneralDiagnostics::DeviceLoadStatus.
The Interaction Model message counters are left at their defaults -
this type knows nothing about them; see
crate::im::InteractionModel::load_stats.
Sourcepub fn notify_event_emitted(
&self,
_endpoint_id: u16,
_cluster_id: u32,
_event_id: u32,
)
pub fn notify_event_emitted( &self, _endpoint_id: u16, _cluster_id: u32, _event_id: u32, )
Notify the instance that a new event has been emitted and that it should re-evaluate the subscriptions and report on those that are interested in the new event.
Public for the integration tests.
Trait Implementations§
Source§impl<const N: usize> Default for Subscriptions<N>
impl<const N: usize> Default for Subscriptions<N>
Source§fn default() -> Subscriptions<N>
fn default() -> Subscriptions<N>
impl<const N: usize> DynBase for Subscriptions<N>
Auto Trait Implementations§
impl<const N: usize = rs_matter::::im::subscriptions::Subscriptions::{constant#0}> !Freeze for Subscriptions<N>
impl<const N: usize = rs_matter::::im::subscriptions::Subscriptions::{constant#0}> !RefUnwindSafe for Subscriptions<N>
impl<const N: usize = rs_matter::::im::subscriptions::Subscriptions::{constant#0}> !Sync for Subscriptions<N>
impl<const N: usize> Send for Subscriptions<N>
impl<const N: usize> Unpin for Subscriptions<N>
impl<const N: usize> UnsafeUnpin for Subscriptions<N>
impl<const N: usize> UnwindSafe for Subscriptions<N>
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