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 installed_chime_sounds<P>(
        &self,
        ctx: impl ReadContext,
        builder: ArrayAttributeRead<ChimeSoundStructArrayBuilder<P>, ChimeSoundStructBuilder<P>>,
    ) -> Result<P, Error>
       where P: TLVBuilderParent;
    async fn selected_chime(&self, ctx: impl ReadContext) -> Result<u8, Error>;
    async fn enabled(&self, ctx: impl ReadContext) -> Result<bool, Error>;
    async fn set_selected_chime(
        &self,
        ctx: impl WriteContext,
        value: u8,
    ) -> Result<(), Error>;
    async fn set_enabled(
        &self,
        ctx: impl WriteContext,
        value: bool,
    ) -> Result<(), Error>;
    async fn handle_play_chime_sound(
        &self,
        ctx: impl InvokeContext,
        request: PlayChimeSoundRequest<'_>,
    ) -> 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§

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 installed_chime_sounds<P>( &self, ctx: impl ReadContext, builder: ArrayAttributeRead<ChimeSoundStructArrayBuilder<P>, ChimeSoundStructBuilder<P>>, ) -> Result<P, Error>

Source

async fn selected_chime(&self, ctx: impl ReadContext) -> Result<u8, Error>

Source

async fn enabled(&self, ctx: impl ReadContext) -> Result<bool, Error>

Source

async fn set_selected_chime( &self, ctx: impl WriteContext, value: u8, ) -> Result<(), Error>

Source

async fn set_enabled( &self, ctx: impl WriteContext, value: bool, ) -> Result<(), Error>

Source

async fn handle_play_chime_sound( &self, ctx: impl InvokeContext, request: PlayChimeSoundRequest<'_>, ) -> 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>>

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 installed_chime_sounds<P>( &self, ctx: impl ReadContext, builder: ArrayAttributeRead<ChimeSoundStructArrayBuilder<P>, ChimeSoundStructBuilder<P>>, ) -> impl Future<Output = Result<P, Error>>

Source§

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

Source§

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

Source§

fn set_selected_chime( &self, ctx: impl WriteContext, value: u8, ) -> impl Future<Output = Result<(), Error>>

Source§

fn set_enabled( &self, ctx: impl WriteContext, value: bool, ) -> impl Future<Output = Result<(), Error>>

Source§

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

Implementors§