Skip to main content

EventEmitter

Trait EventEmitter 

Source
pub trait EventEmitter {
    // Required method
    fn emit_event<F>(
        &self,
        endpoint_id: u16,
        cluster_id: u32,
        event_id: u32,
        priority: EventPriority,
        f: F,
    ) -> Result<u64, Error>
       where F: FnOnce(EventTLVWrite<'_>) -> Result<(), Error>;
}
Expand description

A trait for emitting events.

Required Methods§

Source

fn emit_event<F>( &self, endpoint_id: u16, cluster_id: u32, event_id: u32, priority: EventPriority, f: F, ) -> Result<u64, Error>
where F: FnOnce(EventTLVWrite<'_>) -> Result<(), Error>,

Emit an event.

§Arguments
  • endpoint_id: The endpoint ID of the cluster that emits the event.
  • cluster_id: The cluster ID of the cluster that emits the event.
  • event_id: The event ID of the event being emitted.
  • priority: The priority of the event.
  • f: A closure that takes an EventTLVWrite and writes the event data into it using TLV encoding.
§Returns
  • Ok(EventNumber): The sequence number of the emitted event, if the event was successfully emitted.
  • Err(Error): An error if the event could not be emitted.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T> EventEmitter for &T
where T: EventEmitter,

Source§

fn emit_event<F>( &self, endpoint_id: u16, cluster_id: u32, event_id: u32, priority: EventPriority, f: F, ) -> Result<u64, Error>
where F: FnOnce(EventTLVWrite<'_>) -> Result<(), Error>,

Implementors§

Source§

impl<C, B, T, K, N, NC, R, const NS: usize, const NE: usize> EventEmitter for InteractionModel<'_, C, B, T, K, N, NC, R, NS, NE>
where C: Crypto, B: Buffers<Vec<u8, rs_matter::::transport::exchange::Buffer::{constant#0}>>, T: DataModel, K: KvBlobStoreAccess, N: Networks,