serde-pgrow 0.3.6

Deserialize a serde-type from a PgRow
Documentation
1
2
3
4
5
6
7
8
9
10
use crate::de::PgDeError;
use crate::pg::*;

pub fn ensure_pg_type(ty: &PgType, types: &[PgType]) -> Result<(), PgDeError> {
    if types.into_iter().any(|t| t == ty) {
        Ok(())
    } else {
        Err(PgDeError::UnsupportedType(ty.to_owned()))
    }
}