Commit Graph

109 Commits

Author SHA1 Message Date
kennytm
fa3d56aca8 Rollup merge of #53213 - tmccombs:stable-ipconstructors, r=KodrAus
Stabilize IP associated constants

Fixes #44582
2018-08-21 01:20:10 +08:00
Thayne McCombs
e6244e5979 Stabilize IP associated constants
Fixes #44582
2018-08-14 23:43:21 -06:00
Linus Färnstrand
cbe80a9752 Replace _.. with just .. in slice pattern 2018-08-10 23:42:33 +02:00
Linus Färnstrand
f0eed1e3ff Make use of match ergonomics in ip methods 2018-08-10 21:06:37 +02:00
Linus Färnstrand
2f1f43fcd4 Use slice patterns to check IP octets 2018-08-10 21:06:36 +02:00
Linus Färnstrand
83464591ed Simplify Ipv6Addr::from(octets) to not use unsafe 2018-08-08 10:52:10 +02:00
Linus Färnstrand
d45a703a74 Simplify is_broadcast 2018-08-08 10:52:10 +02:00
Linus Färnstrand
7167a065d1 Add Ipv4Addr BROADCAST assoc const 2018-08-08 10:52:10 +02:00
Linus Färnstrand
e9a96c0433 Move IPs to assoc consts 2018-08-08 10:52:10 +02:00
Linus Färnstrand
02c272db2d Make Ipv{4,6}Addr::new const fns 2018-08-08 10:52:10 +02:00
bors
cb1f89864e Auto merge of #49418 - frewsxcv:frewsxcv-network-order, r=TimNN
Clarify network byte order conversions for integer / IP address conversions.

Opened primarily to address https://github.com/rust-lang/rust/issues/48819.

Also added a few other conversion docs/examples.
2018-04-01 10:09:58 +00:00
Corey Farwell
b89fb71441 Clarify network byte order conversions for integer / IP address conversions.
Opened primarily to address https://github.com/rust-lang/rust/issues/48819.
2018-03-28 13:17:12 +02:00
bors
188e693b39 Auto merge of #49101 - mark-i-m:stabilize_i128, r=nagisa
Stabilize 128-bit integers 🎉

cc #35118

EDIT: This should be merged only after the following have been merged:
- [x] https://github.com/rust-lang-nursery/compiler-builtins/pull/236
- [x] https://github.com/rust-lang/book/pull/1230
2018-03-26 18:41:38 +00:00
Mark Mansi
a7f21f1c0a Fix a few more 2018-03-26 08:37:56 -05:00
Phlosioneer
efd04423c3 Add backticks 2018-03-24 23:41:34 -04:00
Phlosioneer
e63b1a0e36 Remove "and may change between Rust releases" 2018-03-11 17:17:18 -04:00
Phlosioneer
908328fca0 Document when types have OS-dependent sizes
As per issue #43601, types that can change size depending on the
target operating system should say so in their documentation.

I used this template when adding doc comments:

 The size of a(n) <name> struct may vary depending on the target
 operating system, and may change between Rust releases.

For enums, I used "instance" instead of "struct".
2018-03-11 07:53:19 -04:00
varkor
bd1cf04ca7 Reject superfluous :: in IPv6 addresses
Fixes #46263.
2017-12-11 23:02:14 +00:00
Ariel Ben-Yehuda
7dbbbf6607 fix NetBSD 2017-11-26 16:12:43 +02:00
J. Cliff Dyer
9d5b0e1ff5 Add unstable attributes for Ipv?Addr constructors. 2017-09-14 21:30:36 -04:00
J. Cliff Dyer
8b6122f8b8 Add feature gate to doctests. 2017-09-08 20:41:09 -04:00
J. Cliff Dyer
ad170f2339 Close doc examples and trim whitespace. 2017-09-07 19:06:57 -04:00
J. Cliff Dyer
c22db3db6d IP address convenience constructors 2017-09-07 14:08:58 -04:00
Oliver Middleton
49310a9d4d Stop using URL shortener in docs
tidy will no longer complain about long lines containing links so there
is no reason to use a URL shortener here.
2017-08-07 16:33:04 +01:00
Oliver Middleton
2f703e4304 Correct some stability versions
These were found by running tidy on stable versions of rust and finding
features stabilised with the wrong version numbers.
2017-05-20 08:38:39 +01:00
lukaramu
b8cbc5d46a Addressed requested changes for PR #40838
* Fixed spelling ToSocketAddr -> ToSocketAddrs in module docs
  (which also fixes a link)
* Added missing "when" before "interacting" in module docs
* Changed SocketAddr's top-level docs to explicitly state what socket
  addresses consist of, making them more consistent with SocketAddrV4's
  and SocketAddrV6's docs
* Changed "in C" -> "in C's `netinet/in.h`"
* Changed wording in is_ipv4/is_ipv6 methods to ", `false` otherwise"
* Add missing closing ` ``` ` in Ipv6Addr's examples
* Removed "Errors" section in ToSocketAddrs' to_socket_addrs method as it
  was rather redundant
2017-03-27 16:38:17 +02:00
lukaramu
c2601fd358 fix trailing whitespace 2017-03-26 18:06:22 +02:00
lukaramu
6f0c742b00 Expanded and added links to std::net::{SocketAddr,SocketAddrV4,SocketAddrV6} docs
Part of #29363
Changed summary sentences of SocketAddr and IpAddr for consistency
Linked to SocketAddrV4 and SocketAddrV6 from SocketAddr, moving explaination
there
Expanded top-level docs for SocketAddrV4 and SocketAddrV6, linking to some
relevant IETF RFCs, and linking back to SocketAddr
Changed some of the method summaries to third person as per RFC 1574; added
links to IETF RFCs where appropriate
2017-03-26 14:35:12 +02:00
lukaramu
347b70901c Expanded and added links to std::net::{IpAddr,Ipv4Addr,Ipv6Addr} docs
Part of #29363
Expanded top-level documentation & linked to relevant IETF RFCs.
Added a bunch of links (to true/false/Ipv4Addr/etc.) throughout the docs.
2017-03-26 14:35:12 +02:00
lukaramu
0df7398558 std::net docs: changed occurences of "RFC" to say "IETF RFC"
part of #29363
2017-03-26 14:35:12 +02:00
z1mvader
50cede0d31 documented order of conversion between u32 an ipv4addr 2017-03-16 19:59:36 -05:00
Corey Farwell
1d67bb9a0c Rollup merge of #39372 - seanmonstar:more-addr-froms, r=alexcrichton
A few ergonomic From impls for SocketAddr/IpAddr

My main motivation is removing things like this: `"127.0.0.1:3000".parse().unwrap()`. Instead, this now works: `SocketAddr::from(([127, 0, 0, 1], 3000))` or even `([127, 0, 0, 1], 3000).into())` when passing to a function.
2017-02-07 22:54:21 -05:00
Clar Charr
8b2e334e0e Ipv6Addr <-> u128 2017-02-05 18:55:37 -05:00
Sean McArthur
cd603e4324 add From<(I, u16)> for SocketAddr where I: Into<IpAddr> 2017-01-31 15:07:22 -08:00
Sean McArthur
87dcbcada2 add From<[u8; n]> impls for IpAddr 2017-01-28 13:02:48 -08:00
Alex Crichton
671b1c1d89 std: Stabilize APIs for the 1.16.0 release
This commit applies the stabilization/deprecations of the 1.16.0 release, as
tracked by the rust-lang/rust issue tracker and the final-comment-period tag.

The following APIs were stabilized:

* `VecDeque::truncate`
* `VecDeque::resize`
* `String::insert_str`
* `Duration::checked_{add,sub,div,mul}`
* `str::replacen`
* `SocketAddr::is_ipv{4,6}`
* `IpAddr::is_ipv{4,6}`
* `str::repeat`
* `Vec::dedup_by`
* `Vec::dedup_by_key`
* `Result::unwrap_or_default`
* `<*const T>::wrapping_offset`
* `<*mut T>::wrapping_offset`
* `CommandExt::creation_flags` (on Windows)
* `File::set_permissions`
* `String::split_off`

The following APIs were deprecated

* `EnumSet` - replaced with other ecosystem abstractions, long since unstable

Closes #27788
Closes #35553
Closes #35774
Closes #36436
Closes #36949
Closes #37079
Closes #37087
Closes #37516
Closes #37827
Closes #37916
Closes #37966
Closes #38080
2017-01-25 16:43:01 -08:00
bors
74c42ac173 Auto merge of #38464 - clarcharr:ip_cmp, r=sfackler
PartialEq and PartialOrd between IpAddr and Ipv[46]Addr.

PartialEq was rather useful, so, I figured that I'd implement it. I added PartialOrd for good measure.
2017-01-19 03:34:05 +00:00
Yamakaky
2d365c6b7a Impl From<inner> for IpAddr and SocketAddr.
Fixes https://github.com/rust-lang/rfcs/issues/1816.
2016-12-25 18:10:03 -05:00
Yamakaky
40053a46ff Impl From<Ipv4Addr, Ipv6Addr> for IpAddr.
Fixes https://github.com/rust-lang/rfcs/issues/1816.
2016-12-24 23:32:54 -05:00
Clar Charr
9301e2e65d Comparison between IpAddr and Ipv[46]Addr. 2016-12-23 14:51:46 -05:00
Clar Charr
5049ad22ec From<[u16; 8]> for Ipv6Addr. 2016-12-18 23:09:48 -05:00
Corey Farwell
d68c585b01 Rollup merge of #38077 - GuillaumeGomez:ipaddr_doc, r=frewsxcv
Add missing examples for IpAddr enum

r? @frewsxcv
2016-12-03 15:39:52 -05:00
Guillaume Gomez
336e5dd33d Add missing examples for IpAddr enum 2016-11-29 19:44:53 -08:00
Guillaume Gomez
a5049f7bba Add ::1 example in IPv6 to IPv4 conversion 2016-11-23 12:24:04 +01:00
Guillaume Gomez
1a91fc62d3 Add missing examples for Ipv6Addr 2016-11-22 16:49:01 +01:00
Guillaume Gomez
976bfc0322 Add examples for Ipv4Addr 2016-11-16 21:13:44 +01:00
Guillaume Gomez
27acb5ca11 Add missing urls and improve internal doc representation 2016-11-16 19:56:01 +01:00
bors
ead9212c33 Auto merge of #36707 - achanda:ip_type, r=alexcrichton
Add two functions to check type of given address

The is_v4 function returns true if the given IP is v4. The is_v6
function returns true if the IP is v6.
2016-10-10 17:18:01 -07:00
Abhishek Chanda
80a7a3cb0b Add two functions to check type of given address
The is_v4 function returns true if the given IP is v4. The is_v6
function returns true if the IP is v6.
2016-10-03 21:11:19 -07:00
Oliver Middleton
06a7dcd355 std: Correct stability attributes for some implementations
These are displayed by rustdoc so should be correct.
2016-10-01 23:58:14 +01:00