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§
Sourcefn emit_event<F>(
&self,
endpoint_id: u16,
cluster_id: u32,
event_id: u32,
priority: EventPriority,
f: F,
) -> Result<u64, Error>
fn emit_event<F>( &self, endpoint_id: u16, cluster_id: u32, event_id: u32, priority: EventPriority, f: F, ) -> Result<u64, 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 anEventTLVWriteand 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".