MCPcopy Index your code
hub / github.com/ermak-dev/cloudpub / write

Method write

common/src/protocol.rs:385–400  ·  view source on GitHub ↗
(&self, writer: &mut T)

Source from the content-addressed store, hash-verified

383
384impl UdpTraffic {
385 pub async fn write<T: AsyncWrite + Unpin>(&self, writer: &mut T) -> Result<()> {
386 let hdr = UdpHeader {
387 from: self.from,
388 len: self.data.len() as UdpPacketLen,
389 };
390
391 let v = bincode::serde::encode_to_vec(&hdr, bincode::config::legacy()).unwrap();
392
393 trace!("Write {:?} of length {}", hdr, v.len());
394 writer.write_u8(v.len() as u8).await?;
395 writer.write_all(&v).await?;
396
397 writer.write_all(&self.data).await?;
398
399 Ok(())
400 }
401
402 #[allow(dead_code)]
403 pub async fn write_slice<T: AsyncWrite + Unpin>(

Callers 15

readerFunction · 0.80
newMethod · 0.80
main_loopFunction · 0.80
run_control_channelMethod · 0.80
spawnMethod · 0.80
newMethod · 0.80
registerMethod · 0.80
publishMethod · 0.80
startMethod · 0.80
stopMethod · 0.80
unpublishMethod · 0.80
lsMethod · 0.80

Calls 1

lenMethod · 0.80

Tested by

no test coverage detected