Struct svd_rs::cluster::ClusterInfo
source · #[non_exhaustive]pub struct ClusterInfo {
pub name: String,
pub description: Option<String>,
pub alternate_cluster: Option<String>,
pub header_struct_name: Option<String>,
pub address_offset: u32,
pub default_register_properties: RegisterProperties,
pub children: Vec<RegisterCluster>,
pub derived_from: Option<String>,
}
Expand description
Description of a cluster
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.name: String
String to identify the cluster. Cluster names are required to be unique within the scope of a peripheral
description: Option<String>
String describing the details of the register cluster
alternate_cluster: Option<String>
Specify the name of the original cluster if this cluster provides an alternative description
header_struct_name: Option<String>
Specify the struct type name created in the device header file
address_offset: u32
Cluster address relative to the baseAddress
of the peripheral
default_register_properties: RegisterProperties
Default properties for all registers
children: Vec<RegisterCluster>
Children/members of the cluster
derived_from: Option<String>
Specify the cluster name from which to inherit data. Elements specified subsequently override inherited values
Implementations§
source§impl ClusterInfo
impl ClusterInfo
sourcepub fn builder() -> ClusterInfoBuilder
pub fn builder() -> ClusterInfoBuilder
Make a builder for ClusterInfo
sourcepub const fn array(self, dim: DimElement) -> Cluster
pub const fn array(self, dim: DimElement) -> Cluster
Construct Cluster
array
sourcepub fn modify_from(
&mut self,
builder: ClusterInfoBuilder,
lvl: ValidateLevel
) -> Result<(), SvdError>
pub fn modify_from( &mut self, builder: ClusterInfoBuilder, lvl: ValidateLevel ) -> Result<(), SvdError>
Modify an existing ClusterInfo
based on a builder.
sourcepub fn validate(&self, lvl: ValidateLevel) -> Result<(), SvdError>
pub fn validate(&self, lvl: ValidateLevel) -> Result<(), SvdError>
Validate the ClusterInfo
sourcepub fn validate_all(&self, lvl: ValidateLevel) -> Result<(), SvdError>
pub fn validate_all(&self, lvl: ValidateLevel) -> Result<(), SvdError>
Validate the ClusterInfo
recursively
sourcepub fn reg_iter(&self) -> AllRegistersIter<'_> ⓘ
👎Deprecated since 0.12.1: Please use all_registers
instead
pub fn reg_iter(&self) -> AllRegistersIter<'_> ⓘ
all_registers
insteadReturns iterator over all descendant registers
sourcepub fn all_registers(&self) -> AllRegistersIter<'_> ⓘ
pub fn all_registers(&self) -> AllRegistersIter<'_> ⓘ
Returns iterator over all descendant registers
sourcepub fn reg_iter_mut(&mut self) -> AllRegistersIterMut<'_> ⓘ
👎Deprecated since 0.12.1: Please use all_registers_mut
instead
pub fn reg_iter_mut(&mut self) -> AllRegistersIterMut<'_> ⓘ
all_registers_mut
insteadReturns mutable iterator over all descendant registers
sourcepub fn all_registers_mut(&mut self) -> AllRegistersIterMut<'_> ⓘ
pub fn all_registers_mut(&mut self) -> AllRegistersIterMut<'_> ⓘ
Returns mutable iterator over all descendant registers
sourcepub fn registers(&self) -> RegisterIter<'_> ⓘ
pub fn registers(&self) -> RegisterIter<'_> ⓘ
Returns iterator over child registers
sourcepub fn registers_mut(&mut self) -> RegisterIterMut<'_> ⓘ
pub fn registers_mut(&mut self) -> RegisterIterMut<'_> ⓘ
Returns mutable iterator over child registers
sourcepub fn clusters(&self) -> ClusterIter<'_> ⓘ
pub fn clusters(&self) -> ClusterIter<'_> ⓘ
Returns iterator over child clusters
sourcepub fn clusters_mut(&mut self) -> ClusterIterMut<'_> ⓘ
pub fn clusters_mut(&mut self) -> ClusterIterMut<'_> ⓘ
Returns mutable iterator over child clusters
sourcepub fn get_register(&self, name: &str) -> Option<&Register>
pub fn get_register(&self, name: &str) -> Option<&Register>
Get register by name
sourcepub fn get_mut_register(&mut self, name: &str) -> Option<&mut Register>
pub fn get_mut_register(&mut self, name: &str) -> Option<&mut Register>
Get mutable register by name
sourcepub fn get_cluster(&self, name: &str) -> Option<&Cluster>
pub fn get_cluster(&self, name: &str) -> Option<&Cluster>
Get cluster by name
sourcepub fn get_mut_cluster(&mut self, name: &str) -> Option<&mut Cluster>
pub fn get_mut_cluster(&mut self, name: &str) -> Option<&mut Cluster>
Get mutable cluster by name
Trait Implementations§
source§impl Clone for ClusterInfo
impl Clone for ClusterInfo
source§fn clone(&self) -> ClusterInfo
fn clone(&self) -> ClusterInfo
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ClusterInfo
impl Debug for ClusterInfo
source§impl Description for ClusterInfo
impl Description for ClusterInfo
source§fn description(&self) -> Option<&str>
fn description(&self) -> Option<&str>
source§impl From<ClusterInfo> for ClusterInfoBuilder
impl From<ClusterInfo> for ClusterInfoBuilder
source§fn from(c: ClusterInfo) -> Self
fn from(c: ClusterInfo) -> Self
source§impl PartialEq for ClusterInfo
impl PartialEq for ClusterInfo
source§fn eq(&self, other: &ClusterInfo) -> bool
fn eq(&self, other: &ClusterInfo) -> bool
self
and other
values to be equal, and is used
by ==
.