pub async fn encode<W: AsyncWrite + Send + Unpin + 'static>(
    writer: Arc<Mutex<BufWriter<W>>>,
    msg: RpcMessage
) -> Result<(), Box<EncodeError>>
Expand description

Encode the given message into the BufWriter. Flushes the writer when finished.