The CIDR
SQL type. This type can only be used with feature = "network-address"
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);
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
Returns the type id of Self::QueryId
if Self::HAS_STATIC_QUERY_ID
. Returns None
otherwise. Read more
Fetch the metadata for the given type Read more
Formats the value using the given formatter. Read more
Performs copy-assignment from source
. Read more
Returns the "default value" for a type. Read more