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 default_ota_providers<P>(
        &self,
        ctx: impl ReadContext,
        builder: ArrayAttributeRead<ProviderLocationArrayBuilder<P>, ProviderLocationBuilder<P>>,
    ) -> Result<P, Error>
       where P: TLVBuilderParent;
    async fn update_possible(
        &self,
        ctx: impl ReadContext,
    ) -> Result<bool, Error>;
    async fn update_state(
        &self,
        ctx: impl ReadContext,
    ) -> Result<UpdateStateEnum, Error>;
    async fn update_state_progress(
        &self,
        ctx: impl ReadContext,
    ) -> Result<Maybe<u8, AsNullable>, Error>;
    async fn set_default_ota_providers(
        &self,
        ctx: impl WriteContext,
        value: ArrayAttributeWrite<TLVContainer<'_, ProviderLocation<'_>, ArrayContainer>, ProviderLocation<'_>>,
    ) -> Result<(), Error>;
    async fn handle_announce_ota_provider(
        &self,
        ctx: impl InvokeContext,
        request: AnnounceOTAProviderRequest<'_>,
    ) -> 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§

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

Source§

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

Source§

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

Source§

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

Source§

fn set_default_ota_providers( &self, ctx: impl WriteContext, value: ArrayAttributeWrite<TLVContainer<'_, ProviderLocation<'_>, ArrayContainer>, ProviderLocation<'_>>, ) -> impl Future<Output = Result<(), Error>>

Source§

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

Implementors§