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 QueryId for Cidr
[src]
impl QueryId for Cidr
type QueryId = Cidr
A type which uniquely represents Self
in a SQL query. Read more
const HAS_STATIC_QUERY_ID: bool
HAS_STATIC_QUERY_ID: bool = true
Can the SQL generated by Self
be uniquely identified by its type? Read more
fn query_id() -> Option<TypeId>
[src]
fn query_id() -> Option<TypeId>
Returns the type id of Self::QueryId
if Self::HAS_STATIC_QUERY_ID
. Returns None
otherwise. Read more
impl NotNull for Cidr
[src]
impl NotNull for Cidr
impl SingleValue for Cidr
[src]
impl SingleValue for Cidr
impl HasSqlType<Cidr> for Pg
[src]
impl HasSqlType<Cidr> for Pg
fn metadata(_: &PgMetadataLookup) -> PgTypeMetadata
[src]
fn metadata(_: &PgMetadataLookup) -> PgTypeMetadata
Fetch the metadata for the given type Read more
impl Debug for Cidr
[src]
impl Debug for Cidr
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Cidr
[src]
impl Clone for Cidr
fn clone(&self) -> Cidr
[src]
fn clone(&self) -> Cidr
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Copy for Cidr
[src]
impl Copy for Cidr
impl Default for Cidr
[src]
impl Default for Cidr