Skip to main content

ClusterHandler

Trait ClusterHandler 

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

    // Required methods
    fn dataver(&self) -> u32;
    fn dataver_changed(&self);
    fn application_name<P>(
        &self,
        ctx: impl ReadContext,
        builder: Utf8StrBuilder<P>,
    ) -> Result<P, Error>
       where P: TLVBuilderParent;
    fn application<P>(
        &self,
        ctx: impl ReadContext,
        builder: ApplicationStructBuilder<P>,
    ) -> Result<P, Error>
       where P: TLVBuilderParent;
    fn status(
        &self,
        ctx: impl ReadContext,
    ) -> Result<ApplicationStatusEnum, Error>;
    fn application_version<P>(
        &self,
        ctx: impl ReadContext,
        builder: Utf8StrBuilder<P>,
    ) -> Result<P, Error>
       where P: TLVBuilderParent;
    fn allowed_vendor_list<P>(
        &self,
        ctx: impl ReadContext,
        builder: ArrayAttributeRead<ToTLVArrayBuilder<P, u16>, ToTLVBuilder<P, u16>>,
    ) -> Result<P, Error>
       where P: TLVBuilderParent;

    // Provided methods
    fn lifecycle(
        &self,
        _ctx: impl HandlerContext,
        _op: LifecycleOp,
    ) -> Result<(), Error> { ... }
    fn run(
        &self,
        _ctx: impl HandlerContext,
    ) -> impl Future<Output = Result<(), Error>> { ... }
    fn vendor_name<P>(
        &self,
        ctx: impl ReadContext,
        builder: Utf8StrBuilder<P>,
    ) -> Result<P, Error>
       where P: TLVBuilderParent { ... }
    fn vendor_id(&self, ctx: impl ReadContext) -> Result<u16, Error> { ... }
    fn product_id(&self, ctx: impl ReadContext) -> Result<u16, 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

fn application_name<P>( &self, ctx: impl ReadContext, builder: Utf8StrBuilder<P>, ) -> Result<P, Error>

Source

fn application<P>( &self, ctx: impl ReadContext, builder: ApplicationStructBuilder<P>, ) -> Result<P, Error>

Source

fn status(&self, ctx: impl ReadContext) -> Result<ApplicationStatusEnum, Error>

Source

fn application_version<P>( &self, ctx: impl ReadContext, builder: Utf8StrBuilder<P>, ) -> Result<P, Error>

Source

fn allowed_vendor_list<P>( &self, ctx: impl ReadContext, builder: ArrayAttributeRead<ToTLVArrayBuilder<P, u16>, ToTLVBuilder<P, u16>>, ) -> Result<P, 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 vendor_name<P>( &self, ctx: impl ReadContext, builder: Utf8StrBuilder<P>, ) -> Result<P, Error>

Source

fn vendor_id(&self, ctx: impl ReadContext) -> Result<u16, Error>

Source

fn product_id(&self, ctx: impl ReadContext) -> Result<u16, 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> ClusterHandler for &T
where T: ClusterHandler,

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 vendor_name<P>( &self, ctx: impl ReadContext, builder: Utf8StrBuilder<P>, ) -> Result<P, Error>

Source§

fn vendor_id(&self, ctx: impl ReadContext) -> Result<u16, Error>

Source§

fn application_name<P>( &self, ctx: impl ReadContext, builder: Utf8StrBuilder<P>, ) -> Result<P, Error>

Source§

fn product_id(&self, ctx: impl ReadContext) -> Result<u16, Error>

Source§

fn application<P>( &self, ctx: impl ReadContext, builder: ApplicationStructBuilder<P>, ) -> Result<P, Error>

Source§

fn status(&self, ctx: impl ReadContext) -> Result<ApplicationStatusEnum, Error>

Source§

fn application_version<P>( &self, ctx: impl ReadContext, builder: Utf8StrBuilder<P>, ) -> Result<P, Error>

Source§

fn allowed_vendor_list<P>( &self, ctx: impl ReadContext, builder: ArrayAttributeRead<ToTLVArrayBuilder<P, u16>, ToTLVBuilder<P, u16>>, ) -> Result<P, Error>

Implementors§