pub trait Link: Send {
// Required methods
fn open(&mut self, geometry: &Geometry) -> Result<(), LinkError>;
fn close(&mut self) -> Result<(), LinkError>;
fn alloc_tx_buffer(&mut self) -> Result<Vec<TxMessage>, LinkError>;
fn send(&mut self, tx: Vec<TxMessage>) -> Result<(), LinkError>;
fn receive(&mut self, rx: &mut [RxMessage]) -> Result<(), LinkError>;
fn is_open(&self) -> bool;
}Available on crate feature
link only.Expand description
A trait that provides the interface with the device.
Required Methods§
Sourcefn alloc_tx_buffer(&mut self) -> Result<Vec<TxMessage>, LinkError>
fn alloc_tx_buffer(&mut self) -> Result<Vec<TxMessage>, LinkError>
Allocate a sending buffer for the link.
Trait Implementations§
Source§impl Link for Box<dyn Link>
impl Link for Box<dyn Link>
Source§fn alloc_tx_buffer(&mut self) -> Result<Vec<TxMessage>, LinkError>
fn alloc_tx_buffer(&mut self) -> Result<Vec<TxMessage>, LinkError>
Allocate a sending buffer for the link.
Source§fn send(&mut self, tx: Vec<TxMessage>) -> Result<(), LinkError>
fn send(&mut self, tx: Vec<TxMessage>) -> Result<(), LinkError>
Sends a message to the device.