pub fn write_to_stream(
stream: &mut impl WriteOctetStream,
connection_id: ConnectionId,
seed: ConnectionSecretSeed,
payload: &[u8],
) -> Result<()>Expand description
Writes a connection header and a payload to the provided stream, including a Murmur3 hash for validation.
§Arguments
stream- A mutable reference to a stream implementingWriteOctetStream.connection_id- TheConnectionIdto write to the stream.seed- AConnectionSecretSeedused for generating the Murmur3 hash.payload- The payload data to be written and hashed.
§Errors
Returns an io::Result error if writing to the stream fails.