pub struct EthernetCluster(/* private fields */);
Expand description
An EthernetCluster
contains all configuration items associated with an ethernet network.
The cluster connects multiple ECUs.
Implementations§
Source§impl EthernetCluster
impl EthernetCluster
Sourcepub fn create_physical_channel(
&self,
channel_name: &str,
vlan_info: Option<&EthernetVlanInfo>,
) -> Result<EthernetPhysicalChannel, AutosarAbstractionError>
pub fn create_physical_channel( &self, channel_name: &str, vlan_info: Option<&EthernetVlanInfo>, ) -> Result<EthernetPhysicalChannel, AutosarAbstractionError>
Create a new physical channel for the cluster
The supplied VLAN info must be unique - there cannot be two VLANs with the same vlan identifier. One channel may be created without VLAN information; it carries untagged traffic.
§Example
let cluster = system.create_ethernet_cluster("Cluster", &package)?;
let vlan_info = EthernetVlanInfo {
vlan_name: "VLAN_1".to_string(),
vlan_id: 1,
};
let channel = cluster.create_physical_channel("Channel", Some(&vlan_info))?;
§Errors
AutosarAbstractionError::ItemAlreadyExists
There is already a physical channel for this VLANAutosarAbstractionError::ModelError
An error occurred in the Autosar model while trying to create the ECU-INSTANCE
Sourcepub fn physical_channels(
&self,
) -> impl Iterator<Item = EthernetPhysicalChannel> + Send + 'static
pub fn physical_channels( &self, ) -> impl Iterator<Item = EthernetPhysicalChannel> + Send + 'static
returns an iterator over all EthernetPhysicalChannel
s in the cluster
§Example
cluster.create_physical_channel("Channel", None)?;
for channel in cluster.physical_channels() {
// ...
}
Trait Implementations§
Source§impl AbstractCluster for EthernetCluster
impl AbstractCluster for EthernetCluster
Source§impl AbstractionElement for EthernetCluster
impl AbstractionElement for EthernetCluster
Source§impl Clone for EthernetCluster
impl Clone for EthernetCluster
Source§fn clone(&self) -> EthernetCluster
fn clone(&self) -> EthernetCluster
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 EthernetCluster
impl Debug for EthernetCluster
Source§impl From<EthernetCluster> for Cluster
impl From<EthernetCluster> for Cluster
Source§fn from(value: EthernetCluster) -> Self
fn from(value: EthernetCluster) -> Self
Converts to this type from the input type.
Source§impl From<EthernetCluster> for Element
impl From<EthernetCluster> for Element
Source§fn from(val: EthernetCluster) -> Self
fn from(val: EthernetCluster) -> Self
Converts to this type from the input type.
Source§impl Hash for EthernetCluster
impl Hash for EthernetCluster
Source§impl PartialEq for EthernetCluster
impl PartialEq for EthernetCluster
Source§impl TryFrom<Element> for EthernetCluster
impl TryFrom<Element> for EthernetCluster
impl Eq for EthernetCluster
impl StructuralPartialEq for EthernetCluster
Auto Trait Implementations§
impl Freeze for EthernetCluster
impl !RefUnwindSafe for EthernetCluster
impl Send for EthernetCluster
impl Sync for EthernetCluster
impl Unpin for EthernetCluster
impl !UnwindSafe for EthernetCluster
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.