MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / write_message

Function write_message

src/extraction_worker.rs:505–512  ·  view source on GitHub ↗
(writer: &mut W, msg: &T)

Source from the content-addressed store, hash-verified

503}
504
505fn write_message<W: Write, T: Serialize>(writer: &mut W, msg: &T) -> io::Result<()> {
506 let bytes = bincode::serialize(msg).map_err(io::Error::other)?;
507 let len =
508 u32::try_from(bytes.len()).map_err(|_| io::Error::other("ipc message exceeds 4 GiB"))?;
509 writer.write_all(&len.to_le_bytes())?;
510 writer.write_all(&bytes)?;
511 Ok(())
512}
513
514fn slices_eq(a: &[u8], b: &[u8]) -> bool {
515 if a.len() != b.len() {

Callers 3

worker_mainFunction · 0.70
round_trip_with_timeoutFunction · 0.70
message_round_tripsFunction · 0.70

Calls

no outgoing calls

Tested by 1

message_round_tripsFunction · 0.56