pub fn send_msg<W: Write, T: Serialize>(
w: &mut W,
kind: u8,
msg: &T,
) -> Result<(), String>Expand description
Bincode + write helper. The two-step bincode::serialize + write_typed_frame pattern
is the same in every send site so it lives here once.