pub trait FrameTransport<const N: usize> {
type Error: Debug;
// Required methods
fn send(
&mut self,
dst: &NodeAddress,
data: &[u8],
) -> Result<(), Self::Error>;
fn recv(&mut self) -> Option<RawMessage<N>>;
}Expand description
Low-level transport trait for frame-oriented communication.
Implementers of CAN/DoIP runtimes use this trait. The simulation replaces this with an in-memory channel that can inject faults.
Required Associated Types§
Required Methods§
Sourcefn send(&mut self, dst: &NodeAddress, data: &[u8]) -> Result<(), Self::Error>
fn send(&mut self, dst: &NodeAddress, data: &[u8]) -> Result<(), Self::Error>
Sends a raw frame to the given destination.
Sourcefn recv(&mut self) -> Option<RawMessage<N>>
fn recv(&mut self) -> Option<RawMessage<N>>
Receives the next available raw frame, if any. Returns None if no frame is available
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".