From 818100860b695ccbfa9d429ce67f43b5ee7721b8 Mon Sep 17 00:00:00 2001 From: Rakshith Ravi Date: Fri, 19 Aug 2022 12:10:43 +0530 Subject: [PATCH] Update sqlx-core/src/postgres/types/mod.rs Co-authored-by: Austin Bonander --- sqlx-core/src/postgres/types/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sqlx-core/src/postgres/types/mod.rs b/sqlx-core/src/postgres/types/mod.rs index 717210ed05..27c2e18650 100644 --- a/sqlx-core/src/postgres/types/mod.rs +++ b/sqlx-core/src/postgres/types/mod.rs @@ -74,6 +74,12 @@ //! | `ipnetwork::IpNetwork` | INET, CIDR | //! | `std::net::IpAddr` | INET, CIDR | //! +//! Note that because `IpAddr` does not support network prefixes, it is an error to attempt to decode +//! an `IpAddr` from a `INET` or `CIDR` value with a network prefix smaller than the address' full width: +//! `/32` for IPv4 addresses and `/128` for IPv6 addresses. +//! +//! `IpNetwork` does not have this limitation. +//! //! ### [`mac_address`](https://crates.io/crates/mac_address) //! //! Requires the `mac_address` Cargo feature flag.