pub struct ClusterDef {
pub id: u16,
pub name: &'static str,
pub attributes: &'static [AttributeDef],
pub commands: &'static [CommandDef],
pub responses: &'static [CommandDef],
}Expand description
A cluster.
Fields§
§id: u16Cluster id.
name: &'static strsnake_case name.
attributes: &'static [AttributeDef]Attributes, sorted by id.
commands: &'static [CommandDef]Commands the server receives, sorted by id.
responses: &'static [CommandDef]Commands the server generates, sorted by id.
Implementations§
Source§impl ClusterDef
impl ClusterDef
Sourcepub fn attribute(&self, id: u16) -> Option<&'static AttributeDef>
pub fn attribute(&self, id: u16) -> Option<&'static AttributeDef>
The attribute with this id.
Sourcepub fn attribute_by_name(&self, name: &str) -> Option<&'static AttributeDef>
pub fn attribute_by_name(&self, name: &str) -> Option<&'static AttributeDef>
The attribute with this name.
Sourcepub fn command(
&self,
direction: Direction,
id: u8,
) -> Option<&'static CommandDef>
pub fn command( &self, direction: Direction, id: u8, ) -> Option<&'static CommandDef>
The command with this id, sent in direction.
Sourcepub fn command_by_name(
&self,
direction: Direction,
name: &str,
) -> Option<&'static CommandDef>
pub fn command_by_name( &self, direction: Direction, name: &str, ) -> Option<&'static CommandDef>
The command with this name, sent in direction.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ClusterDef
impl RefUnwindSafe for ClusterDef
impl Send for ClusterDef
impl Sync for ClusterDef
impl Unpin for ClusterDef
impl UnsafeUnpin for ClusterDef
impl UnwindSafe for ClusterDef
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more