mirror of
https://github.com/hexedtech/codemp.git
synced 2024-11-22 07:14:50 +01:00
feat: split tx/rx generic in controller
This commit is contained in:
parent
ddbad59ae2
commit
c0bc92e812
1 changed files with 5 additions and 1 deletions
|
@ -26,7 +26,11 @@ use crate::errors::ControllerResult;
|
||||||
/// [`crate::ext::select_buffer`] may provide a useful helper for managing multiple controllers.
|
/// [`crate::ext::select_buffer`] may provide a useful helper for managing multiple controllers.
|
||||||
#[allow(async_fn_in_trait)]
|
#[allow(async_fn_in_trait)]
|
||||||
#[cfg_attr(feature = "async-trait", async_trait::async_trait)]
|
#[cfg_attr(feature = "async-trait", async_trait::async_trait)]
|
||||||
pub trait Controller<T : Sized + Send + Sync> : AsyncSender<T> + AsyncReceiver<T> {}
|
pub trait Controller<Tx, Rx = Tx> : AsyncSender<Tx> + AsyncReceiver<Rx>
|
||||||
|
where
|
||||||
|
Tx: Sized + Sync + Send,
|
||||||
|
Rx: Sized + Sync + Send,
|
||||||
|
{}
|
||||||
|
|
||||||
/// Asynchronous and thread-safe handle to send data over a stream.
|
/// Asynchronous and thread-safe handle to send data over a stream.
|
||||||
/// See [`Controller`]'s documentation for details.
|
/// See [`Controller`]'s documentation for details.
|
||||||
|
|
Loading…
Reference in a new issue