From 3f7111f05de2984aa00ad00fe6a670bca9db0aa0 Mon Sep 17 00:00:00 2001 From: Rakshith Ravi Date: Wed, 24 Aug 2022 04:15:29 +0530 Subject: [PATCH] Updated documentation to reflect inet allows for IpAddr (#2053) Co-authored-by: Austin Bonander Co-authored-by: Austin Bonander --- sqlx-core/src/postgres/types/mod.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sqlx-core/src/postgres/types/mod.rs b/sqlx-core/src/postgres/types/mod.rs index 40d1fc3d..ef6e960f 100644 --- a/sqlx-core/src/postgres/types/mod.rs +++ b/sqlx-core/src/postgres/types/mod.rs @@ -72,6 +72,13 @@ //! | Rust type | Postgres type(s) | //! |---------------------------------------|------------------------------------------------------| //! | `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) //!