/
germanubis
/
sqlx
Обзор
Документация
Войти
/
germanubis
/
sqlx
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
sqlx-postgres/src/types/void.rs
21 строка
532 B
Austin Bonander
Break drivers out into separate crates, clean up some technical debt (#2039)
22 фев 2023, 00:25
22 фев 2023, 00:25
b5312c3
Код
Авторство
О чём код?
use crate::decode::Decode; use crate::error::BoxDynError; use crate::types::Type; use crate::{PgTypeInfo, PgValueRef, Postgres}; impl Type<Postgres> for () { fn type_info() -> PgTypeInfo { PgTypeInfo::VOID } fn compatible(ty: &PgTypeInfo) -> bool { // RECORD is here so we can support the empty tuple *ty == PgTypeInfo::VOID || *ty == PgTypeInfo::RECORD } } impl<'r> Decode<'r, Postgres> for () { fn decode(_value: PgValueRef<'r>) -> Result<Self, BoxDynError> { Ok(()) } }