ssb-handshake 0.5.1

Secret-handshake protocol for Secure Scuttlebutt
Documentation
1
2
3
4
5
6
7
8
9
10
11
use crate::bytes::AsBytes;
use genio::Write;

pub fn send<S, M, IoErr>(stream: &mut S, msg: M) -> Result<(), IoErr>
where
    S: Write<WriteError = IoErr, FlushError = IoErr>,
    M: AsBytes,
{
    stream.write_all(msg.as_bytes())?;
    stream.flush()
}