Skip to main content

ClusterAsyncHandler

Trait ClusterAsyncHandler 

Source
pub trait ClusterAsyncHandler {
    const CLUSTER: Cluster<'static>;

    // Required methods
    fn dataver(&self) -> u32;
    fn dataver_changed(&self);
    async fn handle_set_temperature(
        &self,
        ctx: impl InvokeContext,
        request: SetTemperatureRequest<'_>,
    ) -> 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>> { ... }
    fn temperature_setpoint(
        &self,
        ctx: impl ReadContext,
    ) -> impl Future<Output = Result<i16, Error>> { ... }
    fn min_temperature(
        &self,
        ctx: impl ReadContext,
    ) -> impl Future<Output = Result<i16, Error>> { ... }
    fn max_temperature(
        &self,
        ctx: impl ReadContext,
    ) -> impl Future<Output = Result<i16, Error>> { ... }
    fn step(
        &self,
        ctx: impl ReadContext,
    ) -> impl Future<Output = Result<i16, Error>> { ... }
    fn selected_temperature_level(
        &self,
        ctx: impl ReadContext,
    ) -> impl Future<Output = Result<u8, Error>> { ... }
    fn supported_temperature_levels<P>(
        &self,
        ctx: impl ReadContext,
        builder: ArrayAttributeRead<Utf8StrArrayBuilder<P>, Utf8StrBuilder<P>>,
    ) -> impl Future<Output = Result<P, Error>>
       where P: TLVBuilderParent { ... }
}
Expand description

The handler trait for the cluster.

Required Associated Constants§

Source

const CLUSTER: Cluster<'static>

The cluster-metadata corresponding to this handler trait.

Required Methods§

Source

fn dataver(&self) -> u32

Source

fn dataver_changed(&self)

Source

async fn handle_set_temperature( &self, ctx: impl InvokeContext, request: SetTemperatureRequest<'_>, ) -> Result<(), Error>

Provided Methods§

Source

fn lifecycle( &self, _ctx: impl HandlerContext, _op: LifecycleOp, ) -> Result<(), Error>

Source

fn run( &self, _ctx: impl HandlerContext, ) -> impl Future<Output = Result<(), Error>>

Source

fn temperature_setpoint( &self, ctx: impl ReadContext, ) -> impl Future<Output = Result<i16, Error>>

Source

fn min_temperature( &self, ctx: impl ReadContext, ) -> impl Future<Output = Result<i16, Error>>

Source

fn max_temperature( &self, ctx: impl ReadContext, ) -> impl Future<Output = Result<i16, Error>>

Source

fn step( &self, ctx: impl ReadContext, ) -> impl Future<Output = Result<i16, Error>>

Source

fn selected_temperature_level( &self, ctx: impl ReadContext, ) -> impl Future<Output = Result<u8, Error>>

Source

fn supported_temperature_levels<P>( &self, ctx: impl ReadContext, builder: ArrayAttributeRead<Utf8StrArrayBuilder<P>, Utf8StrBuilder<P>>, ) -> impl Future<Output = Result<P, Error>>

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> ClusterAsyncHandler for &T

Source§

const CLUSTER: Cluster<'static> = T::CLUSTER

Source§

fn dataver(&self) -> u32

Source§

fn dataver_changed(&self)

Source§

fn lifecycle( &self, ctx: impl HandlerContext, op: LifecycleOp, ) -> Result<(), Error>

Source§

fn run( &self, ctx: impl HandlerContext, ) -> impl Future<Output = Result<(), Error>>

Source§

fn temperature_setpoint( &self, ctx: impl ReadContext, ) -> impl Future<Output = Result<i16, Error>>

Source§

fn min_temperature( &self, ctx: impl ReadContext, ) -> impl Future<Output = Result<i16, Error>>

Source§

fn max_temperature( &self, ctx: impl ReadContext, ) -> impl Future<Output = Result<i16, Error>>

Source§

fn step( &self, ctx: impl ReadContext, ) -> impl Future<Output = Result<i16, Error>>

Source§

fn selected_temperature_level( &self, ctx: impl ReadContext, ) -> impl Future<Output = Result<u8, Error>>

Source§

fn supported_temperature_levels<P>( &self, ctx: impl ReadContext, builder: ArrayAttributeRead<Utf8StrArrayBuilder<P>, Utf8StrBuilder<P>>, ) -> impl Future<Output = Result<P, Error>>

Source§

fn handle_set_temperature( &self, ctx: impl InvokeContext, request: SetTemperatureRequest<'_>, ) -> impl Future<Output = Result<(), Error>>

Implementors§