cornucopia_client_core 0.4.0

Private abstractions for Cornucopia clients.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use postgres_types::{Kind, ToSql, Type};

pub fn escape_domain(ty: &Type) -> &Type {
    match ty.kind() {
        Kind::Domain(ty) => ty,
        _ => ty,
    }
}

pub fn slice_iter<'a>(
    s: &'a [&'a (dyn ToSql + Sync)],
) -> impl ExactSizeIterator<Item = &'a dyn ToSql> + 'a {
    s.iter().map(|s| *s as _)
}