pub trait ClusterAsyncHandler {
const CLUSTER: Cluster<'static>;
// Required methods
fn dataver(&self) -> u32;
fn dataver_changed(&self);
async fn available_effects<P>(
&self,
ctx: impl ReadContext,
builder: ArrayAttributeRead<EffectStructArrayBuilder<P>, EffectStructBuilder<P>>,
) -> Result<P, Error>
where P: TLVBuilderParent;
async fn current_effect_id(
&self,
ctx: impl ReadContext,
) -> Result<Maybe<u16, AsNullable>, Error>;
async fn current_speed(
&self,
ctx: impl ReadContext,
) -> Result<Maybe<u16, AsNullable>, Error>;
async fn set_current_speed(
&self,
ctx: impl WriteContext,
value: Maybe<u16, AsNullable>,
) -> Result<(), Error>;
async fn handle_start_effect(
&self,
ctx: impl InvokeContext,
request: StartEffectRequest<'_>,
) -> Result<(), Error>;
async fn handle_stop_effect(
&self,
ctx: impl InvokeContext,
) -> Result<(), Error>;
// Provided methods
fn lifecycle(
&self,
_ctx: impl HandlerContext,
_op: LifecycleOp,
) -> Result<(), Error> { ... }
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 available_effects<P>(
&self,
ctx: impl ReadContext,
builder: ArrayAttributeRead<EffectStructArrayBuilder<P>, EffectStructBuilder<P>>,
) -> Result<P, Error>where
P: TLVBuilderParent,
async fn current_effect_id( &self, ctx: impl ReadContext, ) -> Result<Maybe<u16, AsNullable>, Error>
async fn current_speed( &self, ctx: impl ReadContext, ) -> Result<Maybe<u16, AsNullable>, Error>
async fn set_current_speed( &self, ctx: impl WriteContext, value: Maybe<u16, AsNullable>, ) -> Result<(), Error>
async fn handle_start_effect( &self, ctx: impl InvokeContext, request: StartEffectRequest<'_>, ) -> Result<(), Error>
async fn handle_stop_effect(&self, ctx: impl InvokeContext) -> Result<(), Error>
Provided Methods§
fn lifecycle( &self, _ctx: impl HandlerContext, _op: LifecycleOp, ) -> Result<(), Error>
fn run( &self, _ctx: impl HandlerContext, ) -> impl Future<Output = Result<(), Error>>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".