about summary refs log tree commit diff
path: root/src/libstd/net
AgeCommit message (Collapse)AuthorLines
2018-05-03Remove the deprecated std::net::{lookup_host,LookupHost}Josh Stone-68/+1
These are unstable, and were deprecated by #47510, since Rust 1.25. The internal `sys` implementations are still kept to support the call in the common `resolve_socket_addr`.
2018-04-01Auto merge of #49418 - frewsxcv:frewsxcv-network-order, r=TimNNbors-2/+80
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-03-28Auto merge of #49357 - frewsxcv:frewsxcv-termination-doc-examples, ↵bors-27/+27
r=GuillaumeGomez Remove hidden `foo` functions from doc examples; use `Termination` trait. Fixes https://github.com/rust-lang/rust/issues/49233. Easier to review with the white-space ignoring `?w=1` feature: https://github.com/rust-lang/rust/pull/49357/files?w=1
2018-03-28Clarify network byte order conversions for integer / IP address conversions.Corey Farwell-2/+80
Opened primarily to address https://github.com/rust-lang/rust/issues/48819.
2018-03-28Remove hidden `foo` functions from doc examples; use `Termination` trait.Corey Farwell-27/+27
Fixes https://github.com/rust-lang/rust/issues/49233.
2018-03-26Auto merge of #49101 - mark-i-m:stabilize_i128, r=nagisabors-2/+2
Stabilize 128-bit integers :tada: 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-26Fix a few moreMark Mansi-2/+2
2018-03-26Rollup merge of #48932 - Phlosioneer:43601-document-opaque-size, r=KodrAusTim Neumann-0/+18
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". I added documentation to these types: ``` - std::time::Instant (contains sys::time::Instant) - std::time::SystemTime (contains sys::time::SystemTime) - std::io::StdinRaw (contains sys::stdio::Stdin) - std::io::StdoutRaw (contains sys::stdio::Stdout) - std::io::Stderr (contains sys::stdio::Stderr) - std::net::addr::SocketAddrV4 (contains sys::net::netc::sockaddr_in) - std::net::addr::SocketAddrV6 (contains sys::net::netc::sockaddr_in6) - std::net::addr::SocketAddr (contains std::net::addr::SocketAddrV4 and SocketAddrV6) - std::net::ip::Ipv4Addr (contains sys::net::netc::in_addr) - std::net::ip::Ipv6Addr (contains sys::net::netc::in6_addr) - std::net::ip::IpAddr (contains std::net::ip::Ipv4Addr and Ipv6Addr) ``` I also found that these types varied in size; however, I don't think they need documentation, as it's already fairly obvious that they change based on different OS's: ``` - std::fs::DirBuilder (contains sys::fs::DirBuilder) - std::fs::FileType (contains sys::fs::FileType) - std::fs::Permissions (contains sys::fs::FilePermissions) - std::fs::OpenOptions (contains sys::fs::OpenOptions) - std::fs::DirEntry (contains sys::fs::DirEntry) - std::fs::ReadDir (contains sys::fs::ReadDir) - std::fs::Metadata (contains sys::fs::FileAttr) - std::fs::File (contains sys::fs::File) - std::process::Child (contains sys::process::Process) - std::process::ChildStdin (contains sys::process::AnonPipe) - std::process::ChildStdout (contains sys::process::AnonPipe) - std::process::ChildStderr (contains sys::process::AnonPipe) - std::process::Command (contains sys::process::Command) - std::process::Stdio (contains sys::process::Stdio) - std::process::ExitStatus (contains sys::process::ExitStatus) - std::process::Output (contains std::process::ExitStatus) - std::sys_common::condvar::Condvar (contains sys::condvar::Condvar) - std::sys_common::mutex::Mutex (contains sys::mutex::Mutex) - std::sys_common::net::LookupHost (contains sys::net::netc::addrinfo) - std::sys_common::net::TcpStream (contains sys::net::Socket) - std::sys_common::net::TcpListener (contains sys::net::Socket) - std::sys_common::net::UdpSocket (contains sys::net::Socket) - std::sys_common::remutex::ReentrantMutex (contains sys::mutex::ReentrantMutex) - std::sys_common::rwlock::RWLock (contains sys::rwlock::RWLock) - std::sys_common::thread_local::Key (contains sys::thread_local::Key) ``` Maybe we should just put a comment about the size of structs in the module-level docs for `fs`, `process`, and `sys_common`? If anyone can think of other types that can change size, comment below. I'm also open to changing the wording. closes #43601.
2018-03-24Add backticksPhlosioneer-5/+5
2018-03-20Remove StdioRaw doc additions, add backticksPhlosioneer-1/+1
2018-03-15Improve `AddrParseError` documentation.Anthony Defranceschi-0/+19
Add a potential cause to `AddrParseError` raising.
2018-03-11Remove "and may change between Rust releases"Phlosioneer-6/+6
2018-03-11Document when types have OS-dependent sizesPhlosioneer-0/+18
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-02Rollup merge of #48328 - frewsxcv:frewsxcv-clarify-error-zero-duration, ↵Manish Goregaokar-8/+69
r=sfackler Fixes #47311. r? @nrc
2018-02-25Rollup merge of #48330 - frewsxcv:frewsxcv-tests-zero-duration, r=sfacklerkennytm-0/+37
Add tests ensuring zero-Duration timeouts result in errors; fix Redox issues. Part of #48311
2018-02-24Clarify "It is an error to..." wording for zero-duration behaviors.Corey Farwell-8/+69
Documentation fix side of https://github.com/rust-lang/rust/issues/48311.
2018-02-18Add tests ensuring zero-Duration timeouts result in errors.Corey Farwell-0/+37
Part of https://github.com/rust-lang/rust/issues/48311
2018-02-18Rollup merge of #48312 - frewsxcv:frewsxcv-section-headings, r=QuietMisdreavusGuillaume Gomez-6/+6
Unify 'Platform-specific behavior' documentation headings. None
2018-02-17Unify 'Platform-specific behavior' documentation headings.Corey Farwell-6/+6
2018-01-24Add missing micro version number component in stability attributes.Simon Sapin-4/+4
2018-01-17Deprecate std::net::lookup_hostSteven Fackler-1/+11
We intended to do this quite a while ago but it snuck through.
2018-01-11Make tests build on CloudABI.Ed Schouten-2/+2
There are some tests that need to be disabled on CloudABI specifically, due to the fact that the shims cannot be built in combination with unix::ext or windows::ext. Also improve the scoping of some imports to suppress compiler warnings.
2017-12-11Reject superfluous `::` in IPv6 addressesvarkor-1/+6
Fixes #46263.
2017-12-09Use Try syntax for Option in place of macros or matchMatt Brubeck-5/+1
2017-11-26fix NetBSDAriel Ben-Yehuda-1/+2
2017-11-21Fix a typo in ToSocketAddrs documentationAlexey Orlenko-1/+1
Fix a typo in ToSocketAddrs documentation: s/ToSocketsAddr/ToSocketAddrs
2017-10-26Improve docs for UdpSocket::set_nonblocking.Corey Farwell-4/+33
Closes https://github.com/rust-lang/rust/issues/44050.
2017-10-21Rollup merge of #45419 - steveklabnik:fix-commonmark-renderings, ↵Corey Farwell-1/+1
r=QuietMisdreavus Fix most rendering warnings from switching to CommonMark There's one big one lift, I'm filing a bug for it soon. r? @rust-lang/docs
2017-10-21Rollup merge of #45227 - frewsxcv:frewsxcv-set-nonblocking, r=sfacklerCorey Farwell-7/+66
Expand docs/examples for TCP `set_nonblocking` methods. Part of https://github.com/rust-lang/rust/issues/44050.
2017-10-21Expand docs/examples for TCP `set_nonblocking` methods.Corey Farwell-7/+66
Part of https://github.com/rust-lang/rust/issues/44050.
2017-10-20Fix most rendering warnings from switching to CommonMarksteveklabnik-1/+1
2017-10-14Fix TcpStream::connect_timeout on linuxSteven Fackler-0/+15
Linux appears to set POLLOUT when a conection's refused, which is pretty weird. Invert the check to look for an error explicitly. Also add an explict test for this case. Closes #45265.
2017-10-07Auto merge of #44913 - leavehouse:patch-1, r=BurntSushibors-3/+3
Fix TcpStream::local_addr docs example code The local address's port is not 8080 in this example, that's the remote peer address port. On my machine, the local address is different every time, so I've changed `assert_eq` to only test the IP address
2017-09-28Fix imports in TcpStream::local_addr docs exampleleavehouse-1/+1
Add a missing import and remove unused imports
2017-09-28Fix TcpStream::local_addr example codeleavehouse-2/+2
The local address's port is not 8080 in this example, that's the remote peer address port. On my machine, the local address is different every time, so I've changed `assert_eq` to only test the IP address
2017-09-24Backport libs stabilizations to 1.21 betaDavid Tolnay-1/+1
This includes the following stabilizations: - tcpstream_connect_timeout https://github.com/rust-lang/rust/pull/44563 - iterator_for_each https://github.com/rust-lang/rust/pull/44567 - ord_max_min https://github.com/rust-lang/rust/pull/44593 - compiler_fences https://github.com/rust-lang/rust/pull/44595 - needs_drop https://github.com/rust-lang/rust/pull/44639 - vec_splice https://github.com/rust-lang/rust/pull/44640
2017-09-17Rollup merge of #44647 - tmerr:fix-44645, r=dtolnayTim Neumann-2/+5
Ensure tcp test case passes when disconnected from network net::tcp::tests::connect_timeout_unroutable fails when the network is unreachable, like on a laptop disconnected from wifi. Check for this error and allow the test to pass. Closes #44645
2017-09-17Ensure tcp test case passes when disconnected from networkTrevor Merrifield-2/+5
net::tcp::tests::connect_timeout_unroutable fails when the network is unreachable, like on a laptop disconnected from wifi. Check for this error and allow the test to pass. Closes #44645
2017-09-16Rollup merge of #44395 - jcdyer:ip-constructors, r=alexcrichtonAlex Crichton-1/+89
Ipv4Addr and Ipv6Addr convenience constructors. Introduce convenience constructors for common types. This introduces the following constructors: * Ipv6Addr::localhost() * Ipv6Addr::unspecified() * Ipv4Addr::localhost() * Ipv4Addr::unspecified() The recently added `From` implementations were nice for avoiding the fallibility of conversions from strings like `"127.0.0.1".parse().unwrap()`, and `"::1".parse().unwrap()`, but while the Ipv4 version is roughly comparable in verbosity, the Ipv6 version lacks zero-segment elision, which makes it significantly more awkward: `[0, 0, 0, 0, 0, 0, 0, 0].into()`. While there isn't a clear way to introduce zero elision to type that can infallibly be converted into Ipv6 addresses, this PR resolves the problem for the two most commonly used addresses, which, incidentally, are the ones that suffer the most from the lack of zero-segment elision. This change is dead simple, and introduces no backwards incompatibility. See also, [this topic on the inernals board](https://internals.rust-lang.org/t/pre-rfc-convenience-ip-address-constructors/5878)
2017-09-14Rollup merge of #44563 - budziq:stablilize_tcpstream_connect_timeout, ↵Corey Farwell-1/+1
r=alexcrichton stabilize tcpstream_connect_timeout (closes #43079)
2017-09-14Rollup merge of #44388 - tbu-:pr_doc_udp_connect_multiple, r=frewsxcvCorey Farwell-16/+9
Clarify the behavior of UDP sockets wrt. multiple addresses in `connect` CC @frewsxcv #22569 #44209
2017-09-14Add unstable attributes for Ipv?Addr constructors.J. Cliff Dyer-5/+17
2017-09-14stabilize tcpstream_connect_timeout (closes #43079)Michal Budzynski-1/+1
2017-09-12rustdoc: extend UdpSocket API doc (#657)Frank Rehberger-13/+41
rustdoc: type-fixes
2017-09-08Add feature gate to doctests.J. Cliff Dyer-0/+4
2017-09-07Close doc examples and trim whitespace.J. Cliff Dyer-1/+5
2017-09-07IP address convenience constructorsJ. Cliff Dyer-0/+68
2017-09-07Clarify the behavior of UDP sockets wrt. multiple addresses in `connect`Tobias Bucher-16/+9
2017-08-31Rollup merge of #44209 - frewsxcv:frewsxcv-addr-other-scenarios, r=alexcrichtonMark Simulacrum-6/+92
Expand docs of multi-address behavior of some UDP/TCP APIs. Fixes https://github.com/rust-lang/rust/issues/22569.
2017-08-31Expand docs of multi-address behavior of some UDP/TCP APIs.Corey Farwell-6/+92
Fixes https://github.com/rust-lang/rust/issues/22569.