pub trait ClusterAsyncHandler {
const CLUSTER: Cluster<'static>;
// Required methods
fn dataver(&self) -> u32;
fn dataver_changed(&self);
async fn set_time(&self, ctx: impl ReadContext) -> Result<u32, Error>;
async fn time_remaining(&self, ctx: impl ReadContext) -> Result<u32, Error>;
async fn timer_state(
&self,
ctx: impl ReadContext,
) -> Result<TimerStatusEnum, Error>;
async fn handle_set_timer(
&self,
ctx: impl InvokeContext,
request: SetTimerRequest<'_>,
) -> Result<(), Error>;
async fn handle_reset_timer(
&self,
ctx: impl InvokeContext,
) -> Result<(), Error>;
async fn handle_add_time(
&self,
ctx: impl InvokeContext,
request: AddTimeRequest<'_>,
) -> Result<(), Error>;
async fn handle_reduce_time(
&self,
ctx: impl InvokeContext,
request: ReduceTimeRequest<'_>,
) -> 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 set_time(&self, ctx: impl ReadContext) -> Result<u32, Error>
async fn time_remaining(&self, ctx: impl ReadContext) -> Result<u32, Error>
async fn timer_state( &self, ctx: impl ReadContext, ) -> Result<TimerStatusEnum, Error>
async fn handle_set_timer( &self, ctx: impl InvokeContext, request: SetTimerRequest<'_>, ) -> Result<(), Error>
async fn handle_reset_timer(&self, ctx: impl InvokeContext) -> Result<(), Error>
async fn handle_add_time( &self, ctx: impl InvokeContext, request: AddTimeRequest<'_>, ) -> Result<(), Error>
async fn handle_reduce_time( &self, ctx: impl InvokeContext, request: ReduceTimeRequest<'_>, ) -> Result<(), Error>
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".