diesel/pg/expression/
functions.rs1use super::expression_methods::InetOrCidr;
4use crate::expression::functions::define_sql_function;
5use crate::sql_types::*;
6
7define_sql_function! {
8 #[cfg(feature = "postgres_backend")]
10 fn abbrev<T: InetOrCidr + SingleValue>(addr: T) -> Text;
11}
12define_sql_function! {
13 #[cfg(feature = "postgres_backend")]
15 fn broadcast<T: InetOrCidr + SingleValue>(addr: T) -> Inet;
16}
17define_sql_function! {
18 #[cfg(feature = "postgres_backend")]
20 fn family<T: InetOrCidr + SingleValue>(addr: T) -> Integer;
21}
22define_sql_function! {
23 #[cfg(feature = "postgres_backend")]
25 fn host<T: InetOrCidr + SingleValue>(addr: T) -> Text;
26}
27define_sql_function! {
28 #[cfg(feature = "postgres_backend")]
30 fn hostmask<T: InetOrCidr + SingleValue>(addr: T) -> Inet;
31}
32define_sql_function! {
33 #[cfg(feature = "postgres_backend")]
35 fn inet_merge<T: InetOrCidr + SingleValue, U: InetOrCidr + SingleValue>(a: T, b: U) -> Cidr;
36}
37define_sql_function! {
38 #[cfg(feature = "postgres_backend")]
40 fn inet_same_family<T: InetOrCidr + SingleValue, U: InetOrCidr + SingleValue>(a: T, b: U) -> Bool;
41}
42define_sql_function! {
43 #[cfg(feature = "postgres_backend")]
45 fn masklen<T: InetOrCidr + SingleValue>(addr: T) -> Integer;
46}
47define_sql_function! {
48 #[cfg(feature = "postgres_backend")]
50 fn netmask<T: InetOrCidr + SingleValue>(addr: T) -> Inet;
51}
52define_sql_function! {
53 #[cfg(feature = "postgres_backend")]
56 fn network<T: InetOrCidr + SingleValue>(addr: T) -> Cidr;
57}
58define_sql_function! {
59 #[cfg(feature = "postgres_backend")]
63 fn set_masklen<T: InetOrCidr + SingleValue>(addr: T, len: Integer) -> T;
64}