Commit Graph

170 Commits

Author SHA1 Message Date
021bb38573 Clean up some things as reported by clippy 2016-12-21 09:46:32 +00:00
76f4a889a5 Update clippy 2016-12-21 09:37:51 +00:00
d283ca6240 Implement mask for IpNetwork 2016-12-19 17:07:03 +00:00
56197b3d32 Add some docs for the top level enum 2016-12-19 16:42:25 +00:00
84721241c5 Cleanup parse_addr
It has been moved to `common`
2016-12-17 15:52:36 +00:00
c80c3682a8 Remove from_cidr 2016-12-17 15:48:22 +00:00
d368d2bf02 Use the new ? operator 2016-12-08 12:07:34 +00:00
1df7900ffe Implement FromStr for IPv6 2016-09-22 20:22:50 -07:00
c16cd32ed0 Mark from_cidr as deprecated
- Also refactored a bit
- Updated doc tests
2016-09-21 18:40:13 -07:00
7b829e5e5a Implement FromStr for Ipv4Network
This should be more idiomatic Rust, following the examples in stdlib
2016-09-21 14:47:20 -07:00
8463a3fc5e Add ip_mask_to_prefix, ipv4_mask_to_prefix and ipv6_mask_to_prefix 2016-07-23 18:07:47 +01:00
6a7838c2b0 Add mask and contains to Ipv6Network 2016-07-14 22:20:02 +02:00
6bb344bab3 Make mask, network and broadcast return Ipv4Addr 2016-06-30 19:41:49 +02:00
7346d133b3 rust-fmt 2016-06-30 19:41:48 +02:00
3ebfd5d973 Simplify ipv4 broadcast implementation 2016-06-30 05:18:36 +02:00
e07de702db Add documentation to some IPv4 methods 2016-06-30 05:08:54 +02:00
1d5ea2956f Move ipv4 iter method after constructors 2016-06-30 04:35:33 +02:00
3a083746f5 Remove code from lib.rs and import from submodules 2016-06-30 04:34:06 +02:00
5950239744 Add code to submodules 2016-06-30 04:33:13 +02:00
0275491079 Implement an iterator for Ipv4Network 2016-06-29 20:11:01 +02:00
31d890735d Manually implement Display, uglier debug 2016-06-20 15:55:35 +02:00
b5b0856a04 Formatting 2016-06-20 13:20:40 +02:00
7dcbf53a0f Make IpNetworkError Clone,Eq,PartialEq 2016-06-20 13:20:28 +02:00
b50643fbae Make structs Copy,Hash,Eq,PartialEq 2016-06-20 13:18:44 +02:00
17e96ae764 Make the network structs/enums clonable 2016-06-20 01:00:19 +02:00
1bb9b2c794 Allow non-zero host bits in from_cidr 2016-06-18 08:29:33 +02:00
81a9029fa3 Add from_cidr test 2016-06-18 08:05:18 +02:00
97af56a7c7 Return Results since arguments can be invalid nets 2016-06-18 08:00:36 +02:00
8d57734a7d Make /32 net have size 1 2016-06-18 07:50:01 +02:00
b1837c10fa Add size and nth to Ipv4Network 2016-06-18 07:19:53 +02:00
dc763d2d03 Fix Ipv4Network::mask shift overflow bug 2016-06-18 06:32:03 +02:00
0f9416f3b4 Fix Ipv4Network::contains bug 2016-06-13 22:58:01 +02:00
e812eb66ca Drop the ip crate 2016-03-19 11:12:01 -07:00
af76578eac Add check that IP in CIDR is network 2016-02-12 21:26:12 +01:00
235399c7e7 Add from_cidr to parse strs 2016-02-12 21:25:40 +01:00
cff60d0cd9 Revert "Revert "Use the ip crate""
This reverts commit d5422c0fd7.
2016-02-12 10:48:10 -08:00
168a7b2dcf Remove redundant feature 2016-02-12 00:55:47 -08:00
d5422c0fd7 Revert "Use the ip crate"
This reverts commit 5f84d3a817.
2016-02-12 00:55:11 -08:00
42adf4ee93 Add a broadcast function for IPv4 2016-01-31 22:35:36 -08:00
d84dc6161a Fix the network function and associated tests 2016-01-31 22:29:41 -08:00
eaa36f4b0b Return an instance from the ip method 2016-01-31 22:05:23 -08:00
5f84d3a817 Use the ip crate 2016-01-09 18:02:19 +05:30
af84388f00 Run rustfmt 2015-12-27 00:29:08 +05:30
f8f2d7a499 Some cleanups as reported by clippy 2015-10-25 13:46:31 -07:00
a3d9aa3026 Use clippy 2015-10-25 13:43:52 -07:00
b47592b833 Remove redundant function 2015-08-11 17:20:57 -07:00
26f9d1df55 Remove the unnecessary parentheses 2015-08-11 17:03:08 -07:00
1b74cfda59 Implement a contains() method
This returns true if a given IP belongs to a subnet
2015-08-11 17:00:45 -07:00
9bffd5c5ec Simplify API 2015-08-02 18:32:21 -07:00
b7f691533a Simplify network* functions 2015-05-22 12:58:40 +05:30