use super::expression_methods::InetOrCidr;
use crate::expression::functions::define_sql_function;
use crate::sql_types::*;
define_sql_function! {
#[cfg(feature = "postgres_backend")]
fn abbrev<T: InetOrCidr + SingleValue>(addr: T) -> Text;
}
define_sql_function! {
#[cfg(feature = "postgres_backend")]
fn broadcast<T: InetOrCidr + SingleValue>(addr: T) -> Inet;
}
define_sql_function! {
#[cfg(feature = "postgres_backend")]
fn family<T: InetOrCidr + SingleValue>(addr: T) -> Integer;
}
define_sql_function! {
#[cfg(feature = "postgres_backend")]
fn host<T: InetOrCidr + SingleValue>(addr: T) -> Text;
}
define_sql_function! {
#[cfg(feature = "postgres_backend")]
fn hostmask<T: InetOrCidr + SingleValue>(addr: T) -> Inet;
}
define_sql_function! {
#[cfg(feature = "postgres_backend")]
fn inet_merge<T: InetOrCidr + SingleValue, U: InetOrCidr + SingleValue>(a: T, b: U) -> Cidr;
}
define_sql_function! {
#[cfg(feature = "postgres_backend")]
fn inet_same_family<T: InetOrCidr + SingleValue, U: InetOrCidr + SingleValue>(a: T, b: U) -> Bool;
}
define_sql_function! {
#[cfg(feature = "postgres_backend")]
fn masklen<T: InetOrCidr + SingleValue>(addr: T) -> Integer;
}
define_sql_function! {
#[cfg(feature = "postgres_backend")]
fn netmask<T: InetOrCidr + SingleValue>(addr: T) -> Inet;
}
define_sql_function! {
#[cfg(feature = "postgres_backend")]
fn network<T: InetOrCidr + SingleValue>(addr: T) -> Cidr;
}
define_sql_function! {
#[cfg(feature = "postgres_backend")]
fn set_masklen<T: InetOrCidr + SingleValue>(addr: T, len: Integer) -> T;
}