MCPcopy Create free account
hub / github.com/Botloader/botloader / message_writer

Function message_writer

components/simpleproto/src/lib.rs:36–45  ·  view source on GitHub ↗
(
    dst: &mut (impl AsyncWrite + Unpin),
    mut rx: mpsc::UnboundedReceiver<T>,
)

Source from the content-addressed store, hash-verified

34}
35
36pub 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
47pub async fn message_reader<T: DeserializeOwned>(
48 src: &mut (impl AsyncRead + Unpin),

Callers 2

init_worker_handlesFunction · 0.85
connect_schedulerFunction · 0.85

Calls 2

write_messageFunction · 0.85
recvMethod · 0.80

Tested by

no test coverage detected