Encode a [`RaftRpc`] and wrap the framed bytes in a v2 versioned envelope. The outer envelope allows peers to detect and reject incompatible future wire versions rather than silently misinterpreting them.
(rpc: &RaftRpc)
| 84 | /// The outer envelope allows peers to detect and reject incompatible future |
| 85 | /// wire versions rather than silently misinterpreting them. |
| 86 | pub fn versioned_encode(rpc: &RaftRpc) -> Result<Vec<u8>> { |
| 87 | let framed = encode(rpc)?; |
| 88 | wrap_bytes_versioned(&framed).map_err(|e| ClusterError::Codec { |
| 89 | detail: format!("RaftRpc versioned encode: {e}"), |
| 90 | }) |
| 91 | } |
| 92 | |
| 93 | /// Decode a versioned-envelope-wrapped [`RaftRpc`] frame. |
| 94 | /// |
nothing calls this directly
no test coverage detected