sqlx_core_oldapi/postgres/message/flush.rs
1use crate::io::Encode;
2
3// The Flush message does not cause any specific output to be generated,
4// but forces the backend to deliver any data pending in its output buffers.
5
6// A Flush must be sent after any extended-query command except Sync, if the
7// frontend wishes to examine the results of that command before issuing more commands.
8
9#[derive(Debug)]
10pub struct Flush;
11
12impl Encode<'_> for Flush {
13 fn encode_with(&self, buf: &mut Vec<u8>, _: ()) {
14 buf.push(b'H');
15 buf.extend(&4_i32.to_be_bytes());
16 }
17}