pub struct Inet;
Expand description
The INET
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 -> Inet,
}
}
let addr = IpNetwork::from_str("10.1.9.32/32").unwrap();
let inserted_address = insert_into(clients)
.values(ip_address.eq(&addr))
.returning(ip_address)
.get_result(&connection);
assert_eq!(Ok(addr), inserted_address);
Trait Implementations§
Source§impl HasSqlType<Inet> for Pg
impl HasSqlType<Inet> for Pg
Source§fn metadata(_: &PgMetadataLookup) -> PgTypeMetadata
fn metadata(_: &PgMetadataLookup) -> PgTypeMetadata
Fetch the metadata for the given type Read more
Source§impl QueryId for Inet
impl QueryId for Inet
Source§const HAS_STATIC_QUERY_ID: bool = true
const HAS_STATIC_QUERY_ID: bool = true
Can the SQL generated by
Self
be uniquely identified by its type? Read moreimpl Copy for Inet
impl NotNull for Inet
impl SingleValue for Inet
Auto Trait Implementations§
impl Freeze for Inet
impl RefUnwindSafe for Inet
impl Send for Inet
impl Sync for Inet
impl Unpin for Inet
impl UnwindSafe for Inet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more