Skip to main content

Subscriptions

Struct Subscriptions 

Source
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>

Source

pub const fn new() -> Subscriptions<N>

Create the instance.

Source

pub fn init() -> impl Init<Subscriptions<N>>

Create an in-place initializer for the instance.

Source

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.

Source

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.

Source

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.

Source

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>

Source§

fn default() -> Subscriptions<N>

Returns the “default value” for a type. Read more
Source§

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> 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, E> Init<T, E> for T

Source§

unsafe fn __init(self, slot: *mut T) -> Result<(), E>

Initializes slot. Read more
Source§

fn chain<F>(self, f: F) -> ChainInit<Self, F, T, E>
where F: FnOnce(&mut T) -> Result<(), E>,

First initializes the value using self then calls the function f with the initialized value. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T, I> IntoFallibleInit<T> for I
where I: Init<T>,

Source§

fn into_fallible<E>(self) -> impl Init<T, E>

Convert the infallible initializer to a fallible one.
Source§

impl<Source, Target> OctetsInto<Target> for Source
where Target: OctetsFrom<Source>,

Source§

type Error = <Target as OctetsFrom<Source>>::Error

Source§

fn try_octets_into( self, ) -> Result<Target, <Source as OctetsInto<Target>>::Error>

Performs the conversion.
Source§

fn octets_into(self) -> Target
where Self::Error: Into<Infallible>,

Performs an infallible conversion.
Source§

impl<T, E> PinInit<T, E> for T

Source§

unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), E>

Initializes slot. Read more
Source§

fn pin_chain<F>(self, f: F) -> ChainPinInit<Self, F, T, E>
where F: FnOnce(Pin<&mut T>) -> Result<(), E>,

First initializes the value using self then calls the function f with the initialized value. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V