pub struct CanCommunicationController(/* private fields */);Expand description
An EcuInstance needs a CanCommunicationController in order to connect to a CAN cluster.
Implementations§
Source§impl CanCommunicationController
impl CanCommunicationController
Sourcepub fn connected_channels(
&self,
) -> impl Iterator<Item = CanPhysicalChannel> + Send + use<>
pub fn connected_channels( &self, ) -> impl Iterator<Item = CanPhysicalChannel> + Send + use<>
return an iterator over the CanPhysicalChannels connected to this controller
§Example
let can_controller = ecu_instance.create_can_communication_controller("CanCtrl")?;
can_controller.connect_physical_channel("connection", &physical_channel)?;
for channel in can_controller.connected_channels() {
// ...
}§Errors
AutosarAbstractionError::ModelErrorAn error occurred in the Autosar model while trying to get the ECU-INSTANCE
Sourcepub fn connect_physical_channel(
&self,
connection_name: &str,
can_channel: &CanPhysicalChannel,
) -> Result<CanCommunicationConnector, AutosarAbstractionError>
pub fn connect_physical_channel( &self, connection_name: &str, can_channel: &CanPhysicalChannel, ) -> Result<CanCommunicationConnector, AutosarAbstractionError>
Connect this CanCommunicationController inside an EcuInstance to a CanPhysicalChannel in the crate::System
Creates a CanCommunicationConnector in the EcuInstance that contains this CanCommunicationController.
This function establishes the relationships:
CanPhysicalChannel->CanCommunicationConnectorCanCommunicationConnector->CanCommunicationController
§Example
let can_controller = ecu_instance.create_can_communication_controller("CanCtrl")?;
can_controller.connect_physical_channel("connection", &physical_channel)?;§Errors
AutosarAbstractionError::ModelErrorAn error occurred in the Autosar model while trying to create the ECU-INSTANCE
Trait Implementations§
Source§impl AbstractCommunicationController for CanCommunicationController
impl AbstractCommunicationController for CanCommunicationController
Source§fn ecu_instance(&self) -> Result<EcuInstance, AutosarAbstractionError>
fn ecu_instance(&self) -> Result<EcuInstance, AutosarAbstractionError>
Source§impl Clone for CanCommunicationController
impl Clone for CanCommunicationController
Source§fn clone(&self) -> CanCommunicationController
fn clone(&self) -> CanCommunicationController
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 CanCommunicationController
impl Debug for CanCommunicationController
Source§impl From<CanCommunicationController> for CommunicationController
impl From<CanCommunicationController> for CommunicationController
Source§fn from(value: CanCommunicationController) -> Self
fn from(value: CanCommunicationController) -> Self
Converts to this type from the input type.
Source§impl From<CanCommunicationController> for Element
impl From<CanCommunicationController> for Element
Source§fn from(val: CanCommunicationController) -> Self
fn from(val: CanCommunicationController) -> Self
Converts to this type from the input type.
Source§impl Hash for CanCommunicationController
impl Hash for CanCommunicationController
Source§impl TryFrom<Element> for CanCommunicationController
impl TryFrom<Element> for CanCommunicationController
impl Eq for CanCommunicationController
impl StructuralPartialEq for CanCommunicationController
Auto Trait Implementations§
impl Freeze for CanCommunicationController
impl !RefUnwindSafe for CanCommunicationController
impl Send for CanCommunicationController
impl Sync for CanCommunicationController
impl Unpin for CanCommunicationController
impl !UnwindSafe for CanCommunicationController
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.