| 1 | use bytesrust-analyzer cargo bytes 1.11.1 crate/::BytesMutrust-analyzer cargo bytes 1.11.1 bytes_mut/BytesMut#; |
| 2 | use cidr_03rust-analyzer cargo cidr 0.3.2 crate/::{IpCidrrust-analyzer cargo cidr 0.3.2 cidr/IpCidr#, IpInetrust-analyzer cargo cidr 0.3.2 inet/IpInet#}; |
| 3 | use postgres_protocolrust-analyzer cargo postgres-protocol 0.6.12 crate/::typesrust-analyzer cargo postgres-protocol 0.6.12 types/; |
| 4 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::errorrust-analyzer cargo std https://github.com/rust-lang/rust/library/std error/::Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error#; |
| 5 | |
| 6 | use craterust-analyzer cargo postgres-types 0.2.14 crate/::{FromSqlrust-analyzer cargo postgres-types 0.2.14 FromSql#, IsNullrust-analyzer cargo postgres-types 0.2.14 IsNull#, ToSqlrust-analyzer cargo postgres-types 0.2.14 ToSql#, Typerust-analyzer cargo postgres-types 0.2.14 Type#}; |
| 7 | |
| 8 | impl<'a> FromSqlrust-analyzer cargo postgres-types 0.2.14 FromSql#<'a> for IpCidrrust-analyzer cargo cidr 0.3.2 cidr/IpCidr# { |
| 9 | fn from_sqlrust-analyzer cargo postgres-types 0.2.14 cidr_03/impl#[IpCidr][`FromSql<'a>`]from_sql().(_: &Typerust-analyzer cargo postgres-types 0.2.14 Type#, raw: &[u8]) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo postgres-types 0.2.14 cidr_03/impl#[IpCidr][`FromSql<'a>`], Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error# + Syncrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sync# + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send#>> { |
| 10 | let inet = typesrust-analyzer cargo postgres-protocol 0.6.12 types/::inet_from_sqlrust-analyzer cargo postgres-protocol 0.6.12 types/inet_from_sql().(raw)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 11 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(IpCidrrust-analyzer cargo cidr 0.3.2 cidr/IpCidr#::newrust-analyzer cargo cidr 0.3.2 cidr/combined/impl#[IpCidr]new().(inet.addrrust-analyzer cargo postgres-protocol 0.6.12 types/impl#[Inet]addr().(), inet.netmaskrust-analyzer cargo postgres-protocol 0.6.12 types/impl#[Inet]netmask().())?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().) |
| 12 | } |
| 13 | |
| 14 | acceptsrust-analyzer cargo postgres-types 0.2.14 accepts!!(CIDRrust-analyzer cargo postgres-types 0.2.14 type_gen/impl#[Type]CIDR.); |
| 15 | } |
| 16 | |
| 17 | impl ToSqlrust-analyzer cargo postgres-types 0.2.14 ToSql# for IpCidrrust-analyzer cargo cidr 0.3.2 cidr/IpCidr# { |
| 18 | fn to_sqlrust-analyzer cargo postgres-types 0.2.14 cidr_03/impl#[IpCidr][ToSql]to_sql().(&self, _: &Typerust-analyzer cargo postgres-types 0.2.14 Type#, w: &mut BytesMutrust-analyzer cargo bytes 1.11.1 bytes_mut/BytesMut#) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<IsNullrust-analyzer cargo postgres-types 0.2.14 IsNull#, Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error# + Syncrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sync# + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send#>> { |
| 19 | typesrust-analyzer cargo postgres-protocol 0.6.12 types/::inet_to_sqlrust-analyzer cargo postgres-protocol 0.6.12 types/inet_to_sql().(self.first_addressrust-analyzer cargo cidr 0.3.2 cidr/combined/impl#[IpCidr]first_address().(), self.network_lengthrust-analyzer cargo cidr 0.3.2 cidr/combined/impl#[IpCidr]network_length().(), w); |
| 20 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(IsNullrust-analyzer cargo postgres-types 0.2.14 IsNull#::Norust-analyzer cargo postgres-types 0.2.14 IsNull#No#) |
| 21 | } |
| 22 | |
| 23 | acceptsrust-analyzer cargo postgres-types 0.2.14 accepts!!(CIDRrust-analyzer cargo postgres-types 0.2.14 type_gen/impl#[Type]CIDR.); |
| 24 | to_sql_checkedrust-analyzer cargo postgres-types 0.2.14 to_sql_checked!!(); |
| 25 | } |
| 26 | |
| 27 | impl<'a> FromSqlrust-analyzer cargo postgres-types 0.2.14 FromSql#<'a> for IpInetrust-analyzer cargo cidr 0.3.2 inet/IpInet# { |
| 28 | fn from_sqlrust-analyzer cargo postgres-types 0.2.14 cidr_03/impl#[IpInet][`FromSql<'a>`]from_sql().(_: &Typerust-analyzer cargo postgres-types 0.2.14 Type#, raw: &[u8]) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<Selfrust-analyzer cargo postgres-types 0.2.14 cidr_03/impl#[IpInet][`FromSql<'a>`], Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error# + Syncrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sync# + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send#>> { |
| 29 | let inet = typesrust-analyzer cargo postgres-protocol 0.6.12 types/::inet_from_sqlrust-analyzer cargo postgres-protocol 0.6.12 types/inet_from_sql().(raw)?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().; |
| 30 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(IpInetrust-analyzer cargo cidr 0.3.2 inet/IpInet#::newrust-analyzer cargo cidr 0.3.2 inet/combined/impl#[IpInet]new().(inet.addrrust-analyzer cargo postgres-protocol 0.6.12 types/impl#[Inet]addr().(), inet.netmaskrust-analyzer cargo postgres-protocol 0.6.12 types/impl#[Inet]netmask().())?rust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`][Try]branch().) |
| 31 | } |
| 32 | |
| 33 | acceptsrust-analyzer cargo postgres-types 0.2.14 accepts!!(INETrust-analyzer cargo postgres-types 0.2.14 type_gen/impl#[Type]INET.); |
| 34 | } |
| 35 | |
| 36 | impl ToSqlrust-analyzer cargo postgres-types 0.2.14 ToSql# for IpInetrust-analyzer cargo cidr 0.3.2 inet/IpInet# { |
| 37 | fn to_sqlrust-analyzer cargo postgres-types 0.2.14 cidr_03/impl#[IpInet][ToSql]to_sql().(&self, _: &Typerust-analyzer cargo postgres-types 0.2.14 Type#, w: &mut BytesMutrust-analyzer cargo bytes 1.11.1 bytes_mut/BytesMut#) -> Resultrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#<IsNullrust-analyzer cargo postgres-types 0.2.14 IsNull#, Boxrust-analyzer cargo alloc https://github.com/rust-lang/rust/library/alloc boxed/Box#<dyn Errorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core error/Error# + Syncrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Sync# + Sendrust-analyzer cargo core https://github.com/rust-lang/rust/library/core marker/Send#>> { |
| 38 | typesrust-analyzer cargo postgres-protocol 0.6.12 types/::inet_to_sqlrust-analyzer cargo postgres-protocol 0.6.12 types/inet_to_sql().(self.addressrust-analyzer cargo cidr 0.3.2 inet/combined/impl#[IpInet]address().(), self.network_lengthrust-analyzer cargo cidr 0.3.2 inet/combined/impl#[IpInet]network_length().(), w); |
| 39 | Okrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/Result#Ok#(IsNullrust-analyzer cargo postgres-types 0.2.14 IsNull#::Norust-analyzer cargo postgres-types 0.2.14 IsNull#No#) |
| 40 | } |
| 41 | |
| 42 | acceptsrust-analyzer cargo postgres-types 0.2.14 accepts!!(INETrust-analyzer cargo postgres-types 0.2.14 type_gen/impl#[Type]INET.); |
| 43 | to_sql_checkedrust-analyzer cargo postgres-types 0.2.14 to_sql_checked!!(); |
| 44 | } |