fn contains_or_eq<T>(self, other: T) -> dsl::ContainsNetLoose<Self, T>
    where
        T: AsExpression<Inet>,
    {
        Grouped(ContainsNetLoose::new(self, other.as_expression()))
    }
/// Creates a PostgreSQL `>>=` expression.
///
/// This operator returns whether a subnet contains or is equal to another subnet.
///
/// # Example
///
/// ```rust
/// # include!("../../doctest_setup.rs");
/// #
/// # table! {
/// #     hosts {
/// #         id -> Integer,
/// #         address -> Inet,
/// #     }
/// # }
/// #
/// # fn main() {
/// #     run_test().unwrap();
/// # }
/// #
/// # #[cfg(feature = "ipnetwork")]
/// # fn run_test() -> QueryResult<()> {
/// #     use self::hosts::dsl::*;
/// #     use ipnetwork::IpNetwork;
/// #     use std::str::FromStr;
/// #     let conn = &mut establish_connection();
/// #     conn.execute("DROP TABLE IF EXISTS hosts").unwrap();
/// #     conn.execute("CREATE TABLE hosts (id SERIAL PRIMARY KEY, address INET NOT NULL)").unwrap();
/// diesel::insert_into(hosts)
///     .values(vec![address.eq(IpNetwork::from_str("10.0.2.3/24").unwrap()),
///                  address.eq(IpNetwork::from_str("10.0.3.4/23").unwrap())])
///     .execute(conn)?;
///
/// let my_hosts = hosts.select(id)
///     .filter(address.contains_or_eq(IpNetwork::from_str("10.0.2.5").unwrap()))
///     .load::<i32>(conn)?;
/// assert_eq!(vec![1, 2], my_hosts);
///
/// let my_hosts = hosts.select(id)
///     .filter(address.contains_or_eq(IpNetwork::from_str("10.0.2.5/24").unwrap()))
///     .load::<i32>(conn)?;
/// assert_eq!(vec![1, 2], my_hosts);
///
/// let my_hosts = hosts.select(id)
///     .filter(address.contains_or_eq(IpNetwork::from_str("10.0.3.31").unwrap()))
///     .load::<i32>(conn)?;
/// assert_eq!(vec![2], my_hosts);
/// #     Ok(())
/// # }
/// #
/// # #[cfg(not(feature = "ipnetwork"))]
/// # fn run_test() -> QueryResult<()> {
/// #     Ok(())
/// # }
/// ```
Creates a PostgreSQL `>>=` expression.
This operator returns whether a subnet contains or is equal to another subnet.
Creates a PostgreSQL ` >> = ` expression . This operator returns whether a subnet contains or is equal to another subnet .
fn contains_or_eq<T>(self, other: T) -> dsl::ContainsNetLoose<Self, T>
    where
        T: AsExpression<Inet>,
    {
        Grouped(ContainsNetLoose::new(self, other.as_expression()))
    }
fn contains_or_eq < T > ( self , other : T ) -> dsl :: ContainsNetLoose < Self , T > where T : AsExpression < Inet > , { Grouped ( ContainsNetLoose :: new ( self , other . as_expression ( ) ) ) }
Creates a PostgreSQL `>>=` expression.
Creates a PostgreSQL ` >> = ` expression .
self
other
T
self
other
T
example
None
include!("../../doctest_setup.rs");
None
table! {
None
hosts {
None
id -> integer,
None
address -> inet,
None
}
None
}
None
fn main() {
None
run_test().unwrap();
None
}
None
#[cfg(feature = "ipnetwork")]
None
fn run_test() -> queryresult<()> {
None
use self::hosts::dsl::*;
None
use ipnetwork::ipnetwork;
None
use std::str::fromstr;
None
let conn = &mut establish_connection();
None
conn.execute("drop table if exists hosts").unwrap();
None
conn.execute("create table hosts (id serial primary key, address inet not null)").unwrap();


let my_hosts = hosts.select(id)
.filter(address.contains_or_eq(IpNetwork::from_str("10.0.2.5").unwrap()))
.load::(conn)?;
assert_eq!(vec![1, 2], my_hosts).



let my_hosts = hosts.select(id)
.filter(address.contains_or_eq(IpNetwork::from_str("10.0.3.31").unwrap()))
.load::(conn)?;
assert_eq!(vec![2], my_hosts).
let my_hosts = hosts . select ( id ) . filter ( address . contains_or_eq ( IpNetwork :: from_str ( " 10 . 0 . 2 . 5 " ) . unwrap () )) . load :: ( conn ) ? ; assert_eq! ( vec! [ 1 2 ] my_hosts ) . let my_hosts = hosts . select ( id ) . filter ( address . contains_or_eq ( IpNetwork :: from_str ( " 10 . 0 . 3 . 31 " ) . unwrap () )) . load :: ( conn ) ? ; assert_eq! ( vec! [ 2 ] my_hosts ) .
ok(())
None
}
None
#[cfg(not(feature = "ipnetwork"))]
None
fn run_test() -> queryresult<()> {
None
ok(())
None
}
None