pub struct CanCluster(/* private fields */);
Expand description
A CanCluster
contains all configuration items associated with a CAN network.
The cluster connects multiple ECUs.
Implementations§
Source§impl CanCluster
impl CanCluster
Sourcepub fn set_baudrate(&self, baudrate: u32) -> Result<(), AutosarAbstractionError>
pub fn set_baudrate(&self, baudrate: u32) -> Result<(), AutosarAbstractionError>
set the baudrate for this CanCluster
Sourcepub fn set_can_fd_baudrate(
&self,
baudrate: Option<u32>,
) -> Result<(), AutosarAbstractionError>
pub fn set_can_fd_baudrate( &self, baudrate: Option<u32>, ) -> Result<(), AutosarAbstractionError>
set the baudrate for CAN FD for this CanCluster
Sourcepub fn can_fd_baudrate(&self) -> Option<u32>
pub fn can_fd_baudrate(&self) -> Option<u32>
get the baudrate for CAN FD for this CanCluster
Sourcepub fn set_can_xl_baudrate(
&self,
baudrate: Option<u32>,
) -> Result<(), AutosarAbstractionError>
pub fn set_can_xl_baudrate( &self, baudrate: Option<u32>, ) -> Result<(), AutosarAbstractionError>
set the baudrate for CAN XL for this CanCluster
Sourcepub fn can_xl_baudrate(&self) -> Option<u32>
pub fn can_xl_baudrate(&self) -> Option<u32>
get the baudrate for CAN XL for this CanCluster
Sourcepub fn create_physical_channel(
&self,
channel_name: &str,
) -> Result<CanPhysicalChannel, AutosarAbstractionError>
pub fn create_physical_channel( &self, channel_name: &str, ) -> Result<CanPhysicalChannel, AutosarAbstractionError>
Create a new physical channel for the cluster
A can cluster must contain exactly one physical channel; trying to add a second one triggers an error.
§Example
let cluster = system.create_can_cluster("Cluster", &package, None)?;
let channel = cluster.create_physical_channel("Channel")?;
§Errors
AutosarAbstractionError::ItemAlreadyExists
There is already a physical channel in this CAN clusterAutosarAbstractionError::ModelError
An error occurred in the Autosar model while trying to create the ECU-INSTANCE
Sourcepub fn physical_channel(&self) -> Option<CanPhysicalChannel>
pub fn physical_channel(&self) -> Option<CanPhysicalChannel>
return the CanPhysicalChannel
of the Cluster, if it has been created
§Example
if let Some(channel) = cluster.physical_channel() {
}
Trait Implementations§
Source§impl AbstractCluster for CanCluster
impl AbstractCluster for CanCluster
Source§impl AbstractionElement for CanCluster
impl AbstractionElement for CanCluster
Source§impl Clone for CanCluster
impl Clone for CanCluster
Source§fn clone(&self) -> CanCluster
fn clone(&self) -> CanCluster
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for CanCluster
impl Debug for CanCluster
Source§impl From<CanCluster> for Cluster
impl From<CanCluster> for Cluster
Source§fn from(value: CanCluster) -> Self
fn from(value: CanCluster) -> Self
Converts to this type from the input type.
Source§impl From<CanCluster> for Element
impl From<CanCluster> for Element
Source§fn from(val: CanCluster) -> Self
fn from(val: CanCluster) -> Self
Converts to this type from the input type.
Source§impl Hash for CanCluster
impl Hash for CanCluster
Source§impl PartialEq for CanCluster
impl PartialEq for CanCluster
Source§impl TryFrom<Element> for CanCluster
impl TryFrom<Element> for CanCluster
impl Eq for CanCluster
impl StructuralPartialEq for CanCluster
Auto Trait Implementations§
impl Freeze for CanCluster
impl !RefUnwindSafe for CanCluster
impl Send for CanCluster
impl Sync for CanCluster
impl Unpin for CanCluster
impl !UnwindSafe for CanCluster
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.