pub trait ClusterAsyncHandler {
const CLUSTER: Cluster<'static>;
// Required methods
fn dataver(&self) -> u32;
fn dataver_changed(&self);
async fn identify_time(&self, ctx: impl ReadContext) -> Result<u16, Error>;
async fn identify_type(
&self,
ctx: impl ReadContext,
) -> Result<IdentifyTypeEnum, Error>;
async fn set_identify_time(
&self,
ctx: impl WriteContext,
value: u16,
) -> Result<(), Error>;
async fn handle_identify(
&self,
ctx: impl InvokeContext,
request: IdentifyRequest<'_>,
) -> Result<(), Error>;
async fn handle_trigger_effect(
&self,
ctx: impl InvokeContext,
request: TriggerEffectRequest<'_>,
) -> Result<(), Error>;
// Provided method
fn run(
&self,
_ctx: impl HandlerContext,
) -> impl Future<Output = Result<(), Error>> { ... }
}Expand description
The handler trait for the cluster.
Required Associated Constants§
Required Methods§
fn dataver(&self) -> u32
fn dataver_changed(&self)
async fn identify_time(&self, ctx: impl ReadContext) -> Result<u16, Error>
async fn identify_type( &self, ctx: impl ReadContext, ) -> Result<IdentifyTypeEnum, Error>
async fn set_identify_time( &self, ctx: impl WriteContext, value: u16, ) -> Result<(), Error>
async fn handle_identify( &self, ctx: impl InvokeContext, request: IdentifyRequest<'_>, ) -> Result<(), Error>
async fn handle_trigger_effect( &self, ctx: impl InvokeContext, request: TriggerEffectRequest<'_>, ) -> Result<(), Error>
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".