mirror of
https://github.com/achanda/ipnetwork.git
synced 2025-06-17 01:08:53 +00:00
[#153] Add optional JSONSchema implementation for IpNetwork
Problem: No instance of `JSONSchema` is implemented for `IpNetwork`. Solution: Derive implementation via `schemars`. Add corresponding feature to the crate.
This commit is contained in:
@ -5,6 +5,7 @@ const IPV4_BITS: u8 = 32;
|
||||
|
||||
/// Represents a network range where the IP addresses are of v4
|
||||
#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)]
|
||||
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
|
||||
pub struct Ipv4Network {
|
||||
addr: Ipv4Addr,
|
||||
prefix: u8,
|
||||
|
Reference in New Issue
Block a user