Commit Graph

129 Commits

Author SHA1 Message Date
Corentin Henry
8f679977e0 std::net: add Ipv4Addr::is_reserved() 2019-04-22 16:03:32 +02:00
Corentin Henry
aea687c314 std::net: fix doc markdown in Ipv6Addr::is_unique_local() 2019-04-20 11:19:10 +02:00
Corentin Henry
1f0aa4043b std::net: add Ipv6Addr::is_unicast_link_local_strict()
RFC 4291 is a little unclear about what is a unicast link local address.
According to section 2.4, the entire fe80::/10 range is reserved for
these addresses, but section 2.5.3 defines a stricter format for such
addresses.

After a discussion[0] is has been decided to add a different method for
each definition, so this commit:

  - renames is_unicast_link_local() into is_unicast_link_local_strict()
  - relaxed the check in is_unicast_link_local()

[0]: https://github.com/rust-lang/rust/issues/27709#issuecomment-400370706
2019-04-20 11:19:10 +02:00
Corentin Henry
5aea18411e std::net: improve Ipv6Addr::is_unicast_site_local() doc
- quote the RFC
- add a link to the RFC
- fix markdown
2019-04-20 11:19:10 +02:00
Corentin Henry
02d815f3ce std::net: site-local ipv6 prefixes are global 2019-04-20 11:19:10 +02:00
Mazdak Farrokhzad
379c380a60 libstd: deny(elided_lifetimes_in_paths) 2019-03-31 12:56:51 +02:00
Taiki Endo
93b6d9e086 libstd => 2018 2019-02-28 04:06:15 +09:00
kennytm
98a6e720d0 Rollup merge of #58392 - scottmcm:less-shifting-in-net-ip, r=oli-obk
Use less explicit shifting in std::net::ip

Now that we have `{to|from}_be_bytes` the code can be simpler.

(Inspired by PR #57740)
2019-02-20 11:58:26 +08:00
bors
b244f61b77 Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnik
Cosmetic improvements to doc comments

This has been factored out from https://github.com/rust-lang/rust/pull/58036 to only include changes to documentation comments (throughout the rustc codebase).

r? @steveklabnik

Once you're happy with this, maybe we could get it through with r=1, so it doesn't constantly get invalidated? (I'm not sure this will be an issue, but just in case...) Anyway, thanks for your advice so far!
2019-02-12 19:09:24 +00:00
Scott McMurray
5d8058477e Use less explicit shifting in std::net::ip
Now that we have {to|from}_be_bytes the code can be simpler.

(Inspired by PR #57740)
2019-02-11 23:00:01 -08:00
Alexander Regueiro
99ed06eb88 libs: doc comments 2019-02-10 23:57:25 +00:00
Guillaume Gomez
d9f9780918 Rollup merge of #57740 - JakubOnderka:ipv4addr-to_ne_bytes, r=scottmcm
Use `to_ne_bytes` for converting IPv4Addr to octets

It is easier and it should be also faster, because [`to_ne_bytes`](https://doc.rust-lang.org/std/primitive.u32.html#method.to_ne_bytes) just calls `mem::transmute`.
2019-02-10 21:45:08 +01:00
Mark Rousskov
b7f030e114 Bump bootstrap compiler to 1.33 beta 2019-01-26 08:02:08 -07:00
Jakub Onderka
87f5a98a5d Use to_ne_bytes for converting IPv4Address to octets
It is easier and it should be also faster, because `to_ne_bytes` just calls `mem::transmute`.
2019-01-18 19:08:31 +01:00
Mazdak Farrokhzad
14be8a7f14 const-stabilize Ipv4Addr::new 2018-12-31 16:36:39 +01:00
Mark Rousskov
2a663555dd Remove licenses 2018-12-25 21:08:33 -07:00
Pietro Albini
66fcb3ceb2 Rollup merge of #55901 - euclio:speling, r=petrochenkov
fix various typos in doc comments
2018-11-15 11:04:42 +01:00
Andy Russell
4e35cbb22e fix various typos in doc comments 2018-11-13 14:45:31 -05:00
Mazdak Farrokhzad
d1d2aa22c0 reduce list to functions callable in const ctx. 2018-11-10 01:10:07 +01:00
Mazdak Farrokhzad
f65b630d33 constify parts of libstd. 2018-11-10 01:10:07 +01:00
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