Struct diesel::pg::types::sql_types::Cidr [] [src]

pub struct Cidr;

The CIDR SQL type. This type can only be used with feature = "network-address"

ToSql impls

FromSql impls

Examples

extern crate ipnetwork;
use ipnetwork::IpNetwork;

table! {
    clients {
        id -> Integer,
        ip_address -> Cidr,
    }
}

let addr = IpNetwork::from_str("10.1.9.32/32").unwrap();
let inserted_addr = insert_into(clients)
    .values(ip_address.eq(&addr))
    .returning(ip_address)
    .get_result(&connection);
assert_eq!(Ok(addr), inserted_addr);

Trait Implementations

impl<'expr> AsExpression<Cidr> for &'expr IpNetwork
[src]

The expression being returned

[src]

Perform the conversion

impl<'expr2, 'expr> AsExpression<Cidr> for &'expr2 &'expr IpNetwork
[src]

The expression being returned

[src]

Perform the conversion

impl AsExpression<Cidr> for IpNetwork
[src]

The expression being returned

[src]

Perform the conversion

impl FromSql<Cidr, Pg> for IpNetwork
[src]

[src]

See the trait documentation.

impl ToSql<Cidr, Pg> for IpNetwork
[src]

[src]

See the trait documentation.

impl QueryId for Cidr
[src]

A type which uniquely represents Self in a SQL query. Read more

HAS_STATIC_QUERY_ID: bool = true

Can the SQL generated by Self be uniquely identified by its type? Read more

[src]

Returns the type id of Self::QueryId if Self::HAS_STATIC_QUERY_ID. Returns None otherwise. Read more

impl NotNull for Cidr
[src]

impl SingleValue for Cidr
[src]

impl HasSqlType<Cidr> for Pg
[src]

[src]

Fetch the metadata for the given type Read more

[src]

Fetch the metadata for a tuple representing an entire row Read more

impl Debug for Cidr
[src]

[src]

Formats the value using the given formatter. Read more

impl Clone for Cidr
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for Cidr
[src]

impl Default for Cidr
[src]

[src]

Returns the "default value" for a type. Read more

Auto Trait Implementations

impl Send for Cidr

impl Sync for Cidr