(
dst: &mut (impl AsyncWrite + Unpin),
mut rx: mpsc::UnboundedReceiver<T>,
)
| 34 | } |
| 35 | |
| 36 | pub async fn message_writer<T: Serialize>( |
| 37 | dst: &mut (impl AsyncWrite + Unpin), |
| 38 | mut rx: mpsc::UnboundedReceiver<T>, |
| 39 | ) -> std::io::Result<()> { |
| 40 | while let Some(next) = rx.recv().await { |
| 41 | write_message(&next, dst).await? |
| 42 | } |
| 43 | |
| 44 | Ok(()) |
| 45 | } |
| 46 | |
| 47 | pub async fn message_reader<T: DeserializeOwned>( |
| 48 | src: &mut (impl AsyncRead + Unpin), |
no test coverage detected