18677e3b69
Run cargo fmt
2020-01-05 11:38:28 +00:00
986ee0ba1c
Check against specific errors in parsing test
2020-01-05 11:36:49 +00:00
08126f5103
Merge pull request #109 from mullvad/optional-serde
...
Make the serde dependency optional
2019-12-13 16:23:08 +00:00
fa5deed40b
Make the serde dependency optional
2019-12-11 12:51:39 +01:00
5b09d82d43
Fix bug with overflow in iterator
2019-12-11 09:40:55 +01:00
dbf366cfdf
Iterators: reproducer for overflow on high end of iteration
2019-12-11 09:40:55 +01:00
f7d9524f70
Make the iterators slightly better
...
* Implement some useful traits on them.
* Make reference an into-iterator.
2019-12-11 09:40:55 +01:00
152f1a8393
ipnetwork: add netmask constructors
...
This adds constructors to build all network types from a network
address and network mask pair.
2019-11-27 17:20:59 +00:00
31fc25f9ce
cargo: rustfmt whole project
2019-11-27 15:50:47 +00:00
26706b3790
Use slice::iter
instead of into_iter
to avoid future breakage
...
`an_array.into_iter()` currently just works because of the autoref
feature, which then calls `<[T] as IntoIterator>::into_iter`. But
in the future, arrays will implement `IntoIterator`, too. In order
to avoid problems in the future, the call is replaced by `iter()`
which is shorter and more explicit.
2019-10-30 15:32:11 +01:00
a6dfadc21d
Manual import cleanup
2019-03-25 15:24:17 +01:00
61eeb5843f
Run cargo fix --edition-idioms
2019-03-25 15:15:41 +01:00
c2d4b9aeae
Run cargo fix --edition
2019-03-25 15:13:50 +01:00
10d12cd945
Deserialize from String rather &str for ipnetwork:Ipv{4,6}Network
2019-02-20 11:07:29 +00:00
e7c85b5b81
Implement overlaps for both types
2019-02-06 23:29:46 +00:00
439a0deeb7
Implement is_subnet_of and is_supernet_of
2019-02-06 23:14:07 +00:00
1d57287c77
Use from casts in some more places
2018-11-26 16:50:33 +05:30
bbcc53cd94
Remove the feature flag for 128 bit integers
...
Since it is stable now
2018-05-12 13:53:59 +01:00
2286d58728
cargo fmt and clippy
2018-04-17 19:28:45 -05:00
c6ead9d654
remove serde feature flag
2018-04-17 19:28:38 -05:00
de707e35ae
Remove with-serde in favor of just 'serde'
...
https://rust-lang-nursery.github.io/api-guidelines/naming.html#feature-names-are-free-of-placeholder-words-c-feature
2018-04-17 17:03:42 -05:00
4414ae4f0f
direct serialize/deserialize from string/to string
2018-04-16 19:25:22 -05:00
15fa093618
cargo fmt
2018-04-15 21:15:36 -05:00
72326bd96f
use an option
2018-03-27 21:58:10 -05:00
411c71e900
cargo fmt
2018-03-27 21:48:34 -05:00
cc24cceb1a
add test cases
2018-03-27 21:48:29 -05:00
fcdb0c6b87
simpler way of doing it
2018-03-27 21:39:15 -05:00
5fabbc91d5
If there is no prefix, default to number of bits ipv4/32, ipv6/128
2018-03-27 21:36:39 -05:00
c9e25e15fa
Add Serde Feature for IpNetwork
2018-03-14 19:00:38 -07:00
a3528a8f43
Another round of formatting
2017-12-21 17:45:45 +00:00
124330be88
avoid misleading message
...
Closes #61
2017-10-09 11:59:48 +02:00
8ee7f2d1ed
Add two tests for send and sync
...
To prevent future regressions as the library evolves
2017-09-22 17:56:43 +01:00
9db3d5c30d
add From<IpAddr> for IpNetwork
2017-08-22 15:15:18 +00:00
910a52b64b
Add a size method for Ipv6Network
2017-07-11 21:21:00 +01:00
2ee819a438
Add a broadcast method for Ipv6Network
2017-07-11 21:11:39 +01:00
1171e5ae94
Add a network method for Ipv6Network
2017-07-11 21:01:41 +01:00
99203160b9
Add an iterator for ipv6 network. ( #49 )
...
This is feature gated since i128 is not stable yet
2017-07-08 20:28:00 +01:00
ab7d5b32d0
Add PartialOrd and Ord instances for network types.
2017-05-16 10:34:11 +00:00
c11ebdbd5b
Docs update
2016-12-21 17:56:17 +00:00
021bb38573
Clean up some things as reported by clippy
2016-12-21 09:46:32 +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
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
7346d133b3
rust-fmt
2016-06-30 19:41:48 +02:00
5950239744
Add code to submodules
2016-06-30 04:33:13 +02:00