MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / write_framed_raw

Function write_framed_raw

nodedb-cluster/tests/wire_version_handshake.rs:112–116  ·  view source on GitHub ↗

Write a length-prefixed message to a quinn SendStream using the same framing as `handshake_io::write_framed` (4-byte big-endian length + payload).

(send: &mut quinn::SendStream, bytes: &[u8])

Source from the content-addressed store, hash-verified

110/// Write a length-prefixed message to a quinn SendStream using the same
111/// framing as `handshake_io::write_framed` (4-byte big-endian length + payload).
112async fn write_framed_raw(send: &mut quinn::SendStream, bytes: &[u8]) {
113 let len = (bytes.len() as u32).to_be_bytes();
114 send.write_all(&len).await.unwrap();
115 send.write_all(bytes).await.unwrap();
116}
117
118// ── unit-level negotiation tests (no I/O) ────────────────────────────────────
119

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected