Skip to content

Commit 3f7111f

Browse files
Updated documentation to reflect inet allows for IpAddr (#2053)
Co-authored-by: Austin Bonander <[email protected]> Co-authored-by: Austin Bonander <[email protected]>
1 parent 2d65c5d commit 3f7111f

File tree

1 file changed

+7
-0
lines changed
  • sqlx-core/src/postgres/types

1 file changed

+7
-0
lines changed

sqlx-core/src/postgres/types/mod.rs

+7
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@
7272
//! | Rust type | Postgres type(s) |
7373
//! |---------------------------------------|------------------------------------------------------|
7474
//! | `ipnetwork::IpNetwork` | INET, CIDR |
75+
//! | `std::net::IpAddr` | INET, CIDR |
76+
//!
77+
//! Note that because `IpAddr` does not support network prefixes, it is an error to attempt to decode
78+
//! an `IpAddr` from a `INET` or `CIDR` value with a network prefix smaller than the address' full width:
79+
//! `/32` for IPv4 addresses and `/128` for IPv6 addresses.
80+
//!
81+
//! `IpNetwork` does not have this limitation.
7582
//!
7683
//! ### [`mac_address`](https://crates.io/crates/mac_address)
7784
//!

0 commit comments

Comments
 (0)