pub trait DeviceTrait<TMsg, TRequest, TResponse, TAddress>where
Self: Debug + Send + Sync,
TMsg: MsgDataBound + 'static,
TRequest: 'static + RequestResponseBound<TAddress>,
TResponse: 'static + RequestResponseBound<TAddress>,
TAddress: AddressBound,{
// Required method
fn spawn<'async_trait>(
self: Box<Self>,
ch_rx_msgbus_to_device: Receiver<Message<TMsg>>,
ch_tx_device_to_fieldbus: Sender<TRequest>,
ch_rx_fieldbus_to_device: Receiver<TResponse>,
ch_tx_device_to_msgbus: Sender<Message<TMsg>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait;
}
Expand description
Трейт для реализации на структурах обмена данными с подчиненными устройствами
Required Methods§
Sourcefn spawn<'async_trait>(
self: Box<Self>,
ch_rx_msgbus_to_device: Receiver<Message<TMsg>>,
ch_tx_device_to_fieldbus: Sender<TRequest>,
ch_rx_fieldbus_to_device: Receiver<TResponse>,
ch_tx_device_to_msgbus: Sender<Message<TMsg>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
fn spawn<'async_trait>(
self: Box<Self>,
ch_rx_msgbus_to_device: Receiver<Message<TMsg>>,
ch_tx_device_to_fieldbus: Sender<TRequest>,
ch_rx_fieldbus_to_device: Receiver<TResponse>,
ch_tx_device_to_msgbus: Sender<Message<TMsg>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
Запустить опрос