Skip to main content

Cluster

Struct Cluster 

Source
pub struct Cluster {
    pub id: u32,
    pub name: &'static str,
    pub revision: u16,
    pub attributes: &'static [Attribute],
    pub commands: &'static [Command],
    pub events: &'static [Event],
    pub responses: &'static [(u32, &'static StructDef)],
}
Expand description

A cluster: its attributes, commands and events.

Fields§

§id: u32

Cluster id.

§name: &'static str

IDL name, UpperCamelCase.

§revision: u16

Cluster revision the IDL describes.

§attributes: &'static [Attribute]

Attributes, sorted by id, global attributes included.

§commands: &'static [Command]

Commands the server accepts, sorted by id.

§events: &'static [Event]

Events, sorted by id.

§responses: &'static [(u32, &'static StructDef)]

Response commands the server sends, by command id.

Implementations§

Source§

impl Cluster

Source

pub fn attribute(&self, id: u32) -> Option<&'static Attribute>

The attribute with id.

Source

pub fn attribute_by_name(&self, name: &str) -> Option<&'static Attribute>

The attribute named name (case and _ ignored).

Source

pub fn command(&self, id: u32) -> Option<&'static Command>

The command with id.

Source

pub fn command_by_name(&self, name: &str) -> Option<&'static Command>

The command named name (case and _ ignored).

Source

pub fn event(&self, id: u32) -> Option<&'static Event>

The event with id.

Source

pub fn event_by_name(&self, name: &str) -> Option<&'static Event>

The event named name (case and _ ignored).

Source

pub fn response(&self, id: u32) -> Option<&'static StructDef>

The structure of the response command id the server sends.

Trait Implementations§

Source§

impl Debug for Cluster

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Init<T> for T

§

unsafe fn __init(self, slot: *mut T) -> Result<(), !>

Initializes slot. Read more
§

fn chain<F>(self, f: F) -> ChainInit<Self, F, T, E>
where F: FnOnce(&mut T) -> Result<(), E>,

First initializes the value using self then calls the function f with the initialized value. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, I> IntoFallibleInit<T> for I
where I: Init<T>,

§

fn into_fallible<E>(self) -> impl Init<T, E>

Convert the infallible initializer to a fallible one.
§

impl<T> MaybeSend for T
where T: ?Sized,

§

impl<T> MaybeSendSync for T
where T: ?Sized,

§

impl<T> PinInit<T> for T

§

unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), !>

Initializes slot. Read more
§

fn pin_chain<F>(self, f: F) -> ChainPinInit<Self, F, T, E>
where F: FnOnce(Pin<&mut T>) -> Result<(), E>,

First initializes the value using self then calls the function f with the initialized value. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.