pub struct CanPhysicalChannel(/* private fields */);
Expand description
The CanPhysicalChannel
contains all of the communication on a CAN network
Implementations§
Source§impl CanPhysicalChannel
impl CanPhysicalChannel
Sourcepub fn cluster(&self) -> Result<CanCluster, AutosarAbstractionError>
pub fn cluster(&self) -> Result<CanCluster, AutosarAbstractionError>
get the cluster containing this physical channel
§Example
let channel = cluster.create_physical_channel("Channel")?;
let cluster_2 = channel.cluster()?;
assert_eq!(cluster, cluster_2);
Sourcepub fn trigger_frame(
&self,
frame: &CanFrame,
identifier: u32,
addressing_mode: CanAddressingMode,
frame_type: CanFrameType,
) -> Result<CanFrameTriggering, AutosarAbstractionError>
pub fn trigger_frame( &self, frame: &CanFrame, identifier: u32, addressing_mode: CanAddressingMode, frame_type: CanFrameType, ) -> Result<CanFrameTriggering, AutosarAbstractionError>
add a trigger for a CAN frame in this physical channel
§Example
let channel = cluster.create_physical_channel("Channel")?;
let frame = system.create_can_frame("Frame", &frame_package, 8)?;
channel.trigger_frame(&frame, 0x100, CanAddressingMode::Standard, CanFrameType::Can20)?;
Sourcepub fn frame_triggerings(
&self,
) -> impl Iterator<Item = CanFrameTriggering> + Send + 'static
pub fn frame_triggerings( &self, ) -> impl Iterator<Item = CanFrameTriggering> + Send + 'static
iterate over all frame triggerings of this physical channel
§Example
channel.trigger_frame(&frame, 0x100, CanAddressingMode::Standard, CanFrameType::Can20)?;
for ft in channel.frame_triggerings() {
println!("Frame triggering: {:?}", ft);
}
Trait Implementations§
Source§impl AbstractPhysicalChannel for CanPhysicalChannel
impl AbstractPhysicalChannel for CanPhysicalChannel
Source§type CommunicationConnectorType = CanCommunicationConnector
type CommunicationConnectorType = CanCommunicationConnector
the type of communication connector used by this physical channel
Source§fn pdu_triggerings(
&self,
) -> impl Iterator<Item = PduTriggering> + Send + 'static
fn pdu_triggerings( &self, ) -> impl Iterator<Item = PduTriggering> + Send + 'static
iterate over all
PduTriggerings
of this physical channelSource§fn signal_triggerings(
&self,
) -> impl Iterator<Item = ISignalTriggering> + Send + 'static
fn signal_triggerings( &self, ) -> impl Iterator<Item = ISignalTriggering> + Send + 'static
iterate over all
ISignalTriggerings
of this physical channelSource§fn connectors(
&self,
) -> impl Iterator<Item = Self::CommunicationConnectorType> + Send + 'static
fn connectors( &self, ) -> impl Iterator<Item = Self::CommunicationConnectorType> + Send + 'static
iterate over all connectors between this physical channel and any ECU Read more
Source§fn ecu_connector(
&self,
ecu_instance: &EcuInstance,
) -> Option<Self::CommunicationConnectorType>
fn ecu_connector( &self, ecu_instance: &EcuInstance, ) -> Option<Self::CommunicationConnectorType>
get the connector element between this channel and an ecu
Source§impl Clone for CanPhysicalChannel
impl Clone for CanPhysicalChannel
Source§fn clone(&self) -> CanPhysicalChannel
fn clone(&self) -> CanPhysicalChannel
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 CanPhysicalChannel
impl Debug for CanPhysicalChannel
Source§impl From<CanPhysicalChannel> for Element
impl From<CanPhysicalChannel> for Element
Source§fn from(val: CanPhysicalChannel) -> Self
fn from(val: CanPhysicalChannel) -> Self
Converts to this type from the input type.
Source§impl From<CanPhysicalChannel> for PhysicalChannel
impl From<CanPhysicalChannel> for PhysicalChannel
Source§fn from(channel: CanPhysicalChannel) -> Self
fn from(channel: CanPhysicalChannel) -> Self
Converts to this type from the input type.
Source§impl Hash for CanPhysicalChannel
impl Hash for CanPhysicalChannel
Source§impl PartialEq for CanPhysicalChannel
impl PartialEq for CanPhysicalChannel
Source§impl TryFrom<Element> for CanPhysicalChannel
impl TryFrom<Element> for CanPhysicalChannel
impl Eq for CanPhysicalChannel
impl StructuralPartialEq for CanPhysicalChannel
Auto Trait Implementations§
impl Freeze for CanPhysicalChannel
impl !RefUnwindSafe for CanPhysicalChannel
impl Send for CanPhysicalChannel
impl Sync for CanPhysicalChannel
impl Unpin for CanPhysicalChannel
impl !UnwindSafe for CanPhysicalChannel
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.