Add flush() to front-end messages

The PostgreSQL wire protocol has a "Flush" message, which can be used by
the clients for long-lived connections. Add a flush() helper for it.
This commit is contained in:
Pekka Enberg 2022-12-30 13:47:41 +02:00
parent 97db777078
commit d368475b50

View File

@ -271,6 +271,12 @@ where
})
}
#[inline]
pub fn flush(buf: &mut BytesMut) {
buf.put_u8(b'H');
write_body(buf, |_| Ok::<(), io::Error>(())).unwrap();
}
#[inline]
pub fn sync(buf: &mut BytesMut) {
buf.put_u8(b'S');