fn or<T>(self, other: T) -> dsl::OrNet<Self, T>
    where
        T: AsExpression<Inet>,
    {
        Grouped(OrNet::new(self, other.as_expression()))
    }
/// Creates a PostgreSQL `|` expression.
///
/// This operator computes the bitwise OR between two network addresses.
///
/// # 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").unwrap())])
///     .execute(conn)?;
///
/// let addr = hosts
///     .select(address.or(IpNetwork::from_str("0.0.0.255").unwrap()))
///     .first::<IpNetwork>(conn)?;
/// assert_eq!(addr, IpNetwork::from_str("10.0.2.255").unwrap());
/// #     Ok(())
/// # }
/// #
/// # #[cfg(not(feature = "ipnetwork"))]
/// # fn run_test() -> QueryResult<()> {
/// #     Ok(())
/// # }
/// ```
Creates a PostgreSQL `|` expression.
This operator computes the bitwise OR between two network addresses.
Creates a PostgreSQL ` | ` expression . This operator computes the bitwise OR between two network addresses .
fn or<T>(self, other: T) -> dsl::OrNet<Self, T>
    where
        T: AsExpression<Inet>,
    {
        Grouped(OrNet::new(self, other.as_expression()))
    }
fn or < T > ( self , other : T ) -> dsl :: OrNet < Self , T > where T : AsExpression < Inet > , { Grouped ( OrNet :: 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();
None
ok(())
None
}
None
#[cfg(not(feature = "ipnetwork"))]
None
fn run_test() -> queryresult<()> {
None
ok(())
None
}
None