about summary refs log tree commit diff
path: root/src/libstd/net
AgeCommit message (Collapse)AuthorLines
2017-03-26Expanded std::net module docslukaramu-0/+26
Part of #29363
2017-03-26Expanded top-level docs for std::net{TcpListener,TcpStream,UdpSocket}lukaramu-9/+58
Part of #29363
2017-03-26Added links to std::net::Shutdown docs and made them more consistentlukaramu-6/+19
Part of #29363
2017-03-26Added examples to std::net::{SocketAddr, SocketAddrV4, SocketAddrV6} docslukaramu-0/+36
2017-03-26Expanded and added links to std::net::{SocketAddr,SocketAddrV4,SocketAddrV6} ↵lukaramu-26/+90
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-26Removed link in std::net::ToSocketAddr's summary sentencelukaramu-3/+1
Relative links in trait methods don't resolve in e.g. std/primitive.tuple.html :(
2017-03-26Expanded and added links to std::net::{IpAddr,Ipv4Addr,Ipv6Addr} docslukaramu-42/+160
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-26Added links to std::net::AddrParseError's documentationlukaramu-1/+13
Additionally changed the summary sentence to be more consistent with most of the other FromStr implementations' error types.
2017-03-26Added links throughout std::net::ToSocketAddrs' documentationlukaramu-17/+35
Part of #29363 In the section about the default implementations of ToSocketAddrs, I moved the bulletpoint of SocketAddrV4 & SocketAddrV6 to the one stating that SocketAddr is constructed trivially, as this is what's actually the case
2017-03-26std::net docs: changed occurences of "RFC" to say "IETF RFC"lukaramu-24/+24
part of #29363
2017-03-26Update std::net:Incoming's docs to use standard iterator boilerplatelukaramu-8/+8
Part of #29363
2017-03-26added missing links in std::net TCP docslukaramu-6/+17
part of #29363
2017-03-19Rollup merge of #40590 - z1mvader:master, r=steveklabnikCorey Farwell-0/+2
documented order of conversion between u32 an ipv4addr This fixes https://github.com/rust-lang/rust/issues/40118
2017-03-16documented order of conversion between u32 an ipv4addrz1mvader-0/+2
2017-03-13Remove function invokation parens from documentation links.Corey Farwell-19/+19
This was never established as a convention we should follow in the 'More API Documentation Conventions' RFC: https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md
2017-02-07Rollup merge of #39372 - seanmonstar:more-addr-froms, r=alexcrichtonCorey Farwell-0/+29
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-05Ipv6Addr <-> u128Clar Charr-4/+36
2017-02-05Rollup merge of #39393 - ollie27:stab_impls, r=alexcrichtonCorey Farwell-1/+4
Fix a few impl stability attributes The versions show up in rustdoc.
2017-02-05Rollup merge of #38983 - APTy:udp-peek, r=aturonCorey Farwell-0/+151
Add peek APIs to std::net Adds "peek" APIs to `std::net` sockets, including: - `UdpSocket.peek()` - `UdpSocket.peek_from()` - `TcpStream.peek()` These methods enable socket reads without side-effects. That is, repeated calls to `peek()` return identical data. This is accomplished by providing the POSIX flag `MSG_PEEK` to the underlying socket read operations. This also moves the current implementation of `recv_from` out of the platform-independent `sys_common` and into respective `sys/windows` and `sys/unix` implementations. This allows for more platform-dependent implementations where necessary. Fixes #38980
2017-02-04libstd/net: Add `peek` APIs to UdpSocket and TcpStreamTyler Julian-0/+151
These methods enable socket reads without side-effects. That is, repeated calls to peek() return identical data. This is accomplished by providing the POSIX flag MSG_PEEK to the underlying socket read operations. This also moves the current implementation of recv_from out of the platform-independent sys_common and into respective sys/windows and sys/unix implementations. This allows for more platform-dependent implementations.
2017-01-31add From<(I, u16)> for SocketAddr where I: Into<IpAddr>Sean McArthur-2/+9
2017-01-29Fix a few impl stability attributesOliver Middleton-1/+4
The versions show up in rustdoc.
2017-01-28add From<[u8; n]> impls for IpAddrSean McArthur-0/+22
2017-01-25std: Stabilize APIs for the 1.16.0 releaseAlex Crichton-12/+4
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-24Auto merge of #39048 - lambda:impl-tosocketaddrs-for-string, r=alexcrichtonbors-0/+20
impl ToSocketAddrs for String `ToSocketAddrs` is implemented for a number of different types, including `(IpAddr, u16)`, `&str`, and various others, for the convenience of being able to run things like `TcpListener::bind("10.11.12.13:1415")`. However, because this is a generic parameter with a trait bound, if you have a `String` you cannot pass it in, either directly as `TcpListener::bind(string)`, or the `TcpListener::bind(&string)` as you might expect due to deref coercion; you have to use `TcpListener::bind(&*string)`, which is noisy and hard to discover (though #39029 suggests better error messages to make it more discoverable). Rather than making people stumble over this, just implement `ToSocketAddrs` for `String`.
2017-01-22libstd: replace all `try!` with `?` in documentation examplesUtkarsh Kukreti-4/+4
See #38644.
2017-01-20Rollup merge of #39120 - alexcrichton:emscripten-tests, r=brsonAlex Crichton-1/+1
travis: Get an emscripten builder online This commit adds a new entry to the Travis matrix which will execute emscripten test suites. Along the way it updates a few bits of the test suite to continue passing on emscripten, such as: * Ignoring i128/u128 tests as they're presumably just not working (didn't investigate as to why) * Disabling a few process tests (not working on emscripten) * Ignore some num tests in libstd (#39119) * Fix some warnings when compiling
2017-01-19travis: Get an emscripten builder onlineAlex Crichton-1/+1
This commit adds a new entry to the Travis matrix which will execute emscripten test suites. Along the way it updates a few bits of the test suite to continue passing on emscripten, such as: * Ignoring i128/u128 tests as they're presumably just not working (didn't investigate as to why) * Disabling a few process tests (not working on emscripten) * Ignore some num tests in libstd (#39119) * Fix some warnings when compiling
2017-01-19Auto merge of #38464 - clarcharr:ip_cmp, r=sfacklerbors-4/+100
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-13impl ToSocketAddrs for StringBrian Campbell-0/+20
`ToSocketAddrs` is implemented for a number of different types, including `(IpAddr, u16)`, `&str`, and various others, for the convenience of being able to run things like `TcpListener::bind("10.11.12.13:1415")`. However, because this is a generic parameter with a trait bound, if you have a `String` you cannot pass it in, either directly as `TcpListener::bind(string)`, or the `TcpListener::bind(&string)` as you might expect due to deref coercion; you have to use `TcpListener::bind(&*string)`, which is noisy and hard to discover (though #39029 suggests better error messages to make it more discoverable). Rather than making people stumble over this, just implement `ToSocketAddrs` for `String`.
2017-01-13Rollup merge of #38986 - APTy:fix-nonblocking-test, r=aturonGuillaume Gomez-4/+16
std/net/udp: Improve set_nonblocking test While writing a separate change, I noticed the current test for `UdpSocket::set_nonblocking()` is fairly ineffective. This fixes the test so that it validates that a correct error is returned on calls to `recv()` when no data is available.
2017-01-12Auto merge of #38867 - alexcrichton:ignore-test-on-windows, r=brsonbors-0/+1
std: Ignore close_read_wakes_up on Windows It looks like in practice at least this test will not pass on Windows. Empirically it is prone to blocking forever, presumably because a call to `shutdown` doesn't actually wake up other threads on Windows. We don't document this as a guarantee for `shutdown`, nor do we internally rely on it. This test originated in a time long since passed when it was leveraged for canceling I/O, but nowadays there's nothing fancy happening in the standard library so it's not really a productive test anyway, hence just ignoring it on Windows. Closes #31657
2017-01-10std/net/udp: Improve set_nonblocking testTyler Julian-4/+16
2017-01-10Rollup merge of #38799 - minaguib:patch-1, r=steveklabnikSeo Sanghyeon-1/+1
Doc fix
2017-01-07Auto merge of #38327 - Yamakaky:into-ipaddr, r=brsonbors-0/+28
Impl From<Ipv4Addr, Ipv6Addr> for IpAddr. Fixes https://github.com/rust-lang/rfcs/issues/1816.
2017-01-05std: Ignore close_read_wakes_up on WindowsAlex Crichton-0/+1
It looks like in practice at least this test will not pass on Windows. Empirically it is prone to blocking forever, presumably because a call to `shutdown` doesn't actually wake up other threads on Windows. We don't document this as a guarantee for `shutdown`, nor do we internally rely on it. This test originated in a time long since passed when it was leveraged for canceling I/O, but nowadays there's nothing fancy happening in the standard library so it's not really a productive test anyway, hence just ignoring it on Windows. Closes #31657
2017-01-05Deprecate TcpListener::set_only_v6Steven Fackler-32/+6
This was supposed to have been removed in #33124 but snuck through :(
2017-01-03Doc fixMina Naguib-1/+1
2016-12-25Impl From<inner> for IpAddr and SocketAddr.Yamakaky-0/+16
Fixes https://github.com/rust-lang/rfcs/issues/1816.
2016-12-24Impl From<Ipv4Addr, Ipv6Addr> for IpAddr.Yamakaky-0/+12
Fixes https://github.com/rust-lang/rfcs/issues/1816.
2016-12-23Comparison between IpAddr and Ipv[46]Addr.Clar Charr-4/+100
2016-12-20Rollup merge of #38131 - clarcharr:from_segments, r=alexcrichtonAlex Crichton-1/+27
Add From<[u16; 8]> to Ipv6Addr Not really sure that this requires an RFC, but I figured that I'd offer a pull request and see what people think. It seems like a reasonable addition.
2016-12-18From<[u16; 8]> for Ipv6Addr.Clar Charr-1/+27
2016-12-18Implement `fmt::Debug` for all structures in libstd.Corey Farwell-0/+9
Part of https://github.com/rust-lang/rust/issues/31869. Also turn on the `missing_debug_implementations` lint at the crate level.
2016-12-12Rollup merge of #38067 - GuillaumeGomez:udp-doc, r=frewsxcv,nagisaCorey Farwell-1/+58
Add more examples to UpdSocket r? @frewsxcv
2016-12-04Add more examples to UpdSocketGuillaume Gomez-1/+58
2016-12-03Rollup merge of #38077 - GuillaumeGomez:ipaddr_doc, r=frewsxcvCorey Farwell-0/+88
Add missing examples for IpAddr enum r? @frewsxcv
2016-12-03Rollup merge of #38020 - GuillaumeGomez:udp-socket-doc, r=frewsxcvCorey Farwell-11/+215
Add part of missing UdpSocket's urls and examples r? @frewsxcv
2016-12-03Rollup merge of #37859 - GuillaumeGomez:net_examples, r=nagisaCorey Farwell-0/+158
Add missing examples for Ipv6Addr r? @steveklabnik cc @frewsxcv
2016-11-29Add missing examples for IpAddr enumGuillaume Gomez-0/+88