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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional 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

source

pub fn builder() -> ClusterInfoBuilder

Make a builder for ClusterInfo

source

pub const fn single(self) -> Cluster

Construct single Cluster

source

pub const fn array(self, dim: DimElement) -> Cluster

Construct Cluster array

source

pub fn maybe_array(self, dim: Option<DimElement>) -> Cluster

Construct single Cluster or array

source

pub fn modify_from( &mut self, builder: ClusterInfoBuilder, lvl: ValidateLevel ) -> Result<(), SvdError>

Modify an existing ClusterInfo based on a builder.

source

pub fn validate(&self, lvl: ValidateLevel) -> Result<(), SvdError>

Validate the ClusterInfo

source

pub fn validate_all(&self, lvl: ValidateLevel) -> Result<(), SvdError>

Validate the ClusterInfo recursively

source

pub fn reg_iter(&self) -> AllRegistersIter<'_>

👎Deprecated since 0.12.1: Please use all_registers instead

Returns iterator over all descendant registers

source

pub fn all_registers(&self) -> AllRegistersIter<'_>

Returns iterator over all descendant registers

source

pub fn reg_iter_mut(&mut self) -> AllRegistersIterMut<'_>

👎Deprecated since 0.12.1: Please use all_registers_mut instead

Returns mutable iterator over all descendant registers

source

pub fn all_registers_mut(&mut self) -> AllRegistersIterMut<'_>

Returns mutable iterator over all descendant registers

source

pub fn registers(&self) -> RegisterIter<'_>

Returns iterator over child registers

source

pub fn registers_mut(&mut self) -> RegisterIterMut<'_>

Returns mutable iterator over child registers

source

pub fn clusters(&self) -> ClusterIter<'_>

Returns iterator over child clusters

source

pub fn clusters_mut(&mut self) -> ClusterIterMut<'_>

Returns mutable iterator over child clusters

source

pub fn get_register(&self, name: &str) -> Option<&Register>

Get register by name

source

pub fn get_mut_register(&mut self, name: &str) -> Option<&mut Register>

Get mutable register by name

source

pub fn get_cluster(&self, name: &str) -> Option<&Cluster>

Get cluster by name

source

pub fn get_mut_cluster(&mut self, name: &str) -> Option<&mut Cluster>

Get mutable cluster by name

Trait Implementations§

source§

impl Clone for ClusterInfo

source§

fn clone(&self) -> ClusterInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ClusterInfo

source§

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

Formats the value using the given formatter. Read more
source§

impl Description for ClusterInfo

source§

fn description(&self) -> Option<&str>

Get description
source§

impl From<ClusterInfo> for ClusterInfoBuilder

source§

fn from(c: ClusterInfo) -> Self

Converts to this type from the input type.
source§

impl Name for ClusterInfo

source§

fn name(&self) -> &str

Get name
source§

impl PartialEq for ClusterInfo

source§

fn eq(&self, other: &ClusterInfo) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for ClusterInfo

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.

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.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.