/
germanubis
/
sqlx
Обзор
Документация
Войти
/
germanubis
/
sqlx
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
sqlx-postgres/src/message/flush.rs
25 строк
793 B
Austin Bonander
refactor(postgres): make better use of traits to improve protocol handling
24 авг 2024, 09:39
24 авг 2024, 09:39
53766e4
Код
Авторство
О чём код?
use crate::message::{FrontendMessage, FrontendMessageFormat}; use sqlx_core::Error; use std::num::Saturating; /// The Flush message does not cause any specific output to be generated, /// but forces the backend to deliver any data pending in its output buffers. /// /// A Flush must be sent after any extended-query command except Sync, if the /// frontend wishes to examine the results of that command before issuing more commands. #[derive(Debug)] pub struct Flush; impl FrontendMessage for Flush { const FORMAT: FrontendMessageFormat = FrontendMessageFormat::Flush; #[inline(always)] fn body_size_hint(&self) -> Saturating<usize> { Saturating(0) } #[inline(always)] fn encode_body(&self, _buf: &mut Vec<u8>) -> Result<(), Error> { Ok(()) } }