Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Docs: net #29363

Closed
15 tasks
steveklabnik opened this issue Oct 26, 2015 · 3 comments
Closed
15 tasks

API Docs: net #29363

steveklabnik opened this issue Oct 26, 2015 · 3 comments
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools E-help-wanted Call for participation: Help is requested to fix this issue. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. P-medium Medium priority

Comments

@steveklabnik
Copy link
Member

steveklabnik commented Oct 26, 2015

Part of #29329

http://doc.rust-lang.org/std/net/

Here's what needs to be done to close out this issue:

  • the module documentation is very tiny and needs expanded.
  • ParseError needs to link to where it comes from and have examples.
  • Incoming should use the standard iterator boilerplate and move its semantics into the method docs.
  • Ipv4Addr needs better top-level docs and should link to IpAddr
  • many places in these docs should say "IETF RFC" rather than "RFC", as we have Rust RFCs as well.
  • Ipv6Addr same as Ipv4Addr.
  • SocketAddrV4 has poor top-level docs and needs to have a defined summary/explanation split. Its methods are okay, but very short. It needs to link to SocketAddr.
  • SocketAddrV6 same
  • TcpListener's docs don't really say what it is.
  • TcpStream's the same.
  • UpdSocket is the same.
  • IpAddr should link to an IETF RFC
  • Shutdown should use the standard boilerplate
  • SocketAddr has very short docs.
  • ToSocketAddrs needs a lot of links.
@apoelstra
Copy link
Contributor

Hi,

https://doc.rust-lang.org/std/net/struct.Incoming.html

Says that the Incoming iterator will return an infinite list of incoming connections. In fact, it may error out (for example if the system runs out of file descriptors) and return an infinite list of errors, with no delays in between. A naive "log and retry" loop may become a spinloop in this case, pegging the CPU and/or filling log space.

@steveklabnik steveklabnik added the E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. label Mar 8, 2017
@steveklabnik
Copy link
Member Author

I am happy to mentor anyone who wants to tackle this issue.

@steveklabnik steveklabnik added the A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools label Mar 10, 2017
@steveklabnik steveklabnik added P-medium Medium priority E-help-wanted Call for participation: Help is requested to fix this issue. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. and removed A-docs labels Mar 24, 2017
@chordowl
Copy link
Contributor

chordowl commented Mar 24, 2017

I'm gonna try to tackle (parts of?) the docs for TcpListener & TcpStream, especially with regard to #40322 since I've been digging information for that up anyway; I'll probably grab some low-hanging fruit beforehand though.

frewsxcv added a commit to frewsxcv/rust that referenced this issue Mar 29, 2017
…omez

Improve std::net docs

Fixes rust-lang#29363

Summary:
* Added a _lot_ of missing links, both to other types/methods and to IETF RFCs, and changed occurences of just "RFC" to "IETF RFC"
* Expanded a bunch of top-level docs, specifically the module docs & the docs for `TcpListener`, `TcpStream`, `UdpSocket`, `IpAddr`, `Ipv4Addr`, `Ipv6Addr`, `SocketAddr`, `SocketAddrV4`, `SocketAddrV6`,
* Expanded method docs for `SocketAddrV6`, `AddrParseError`,
* Various edits for clarity, consistency, and accuracy

See the commit descriptions for more detail.

Things not done quite as laid out in the task list in rust-lang#29363:
* `AddrParseError` still doesn't have examples, but I wasn't quite sure how to do them; other `FromStr` error types don't have any, either
* I didn't link to an IETF RFC in `IpAddr`, but in `Ipv4Addr` and `Ipv6Addr` and linked tho those from `IpAddr`; this seems more appropriate to me
* Similarly, I didn't really exand `SocketAddr`'s docs, but elaborated on `SocketAddrV4` and `SocketAddrV6`'s and linked to them from `SocketAddr`

Theres definitely still room for improvement, but this should be a good first effort 😄
frewsxcv added a commit to frewsxcv/rust that referenced this issue Mar 29, 2017
…omez

Improve std::net docs

Fixes rust-lang#29363

Summary:
* Added a _lot_ of missing links, both to other types/methods and to IETF RFCs, and changed occurences of just "RFC" to "IETF RFC"
* Expanded a bunch of top-level docs, specifically the module docs & the docs for `TcpListener`, `TcpStream`, `UdpSocket`, `IpAddr`, `Ipv4Addr`, `Ipv6Addr`, `SocketAddr`, `SocketAddrV4`, `SocketAddrV6`,
* Expanded method docs for `SocketAddrV6`, `AddrParseError`,
* Various edits for clarity, consistency, and accuracy

See the commit descriptions for more detail.

Things not done quite as laid out in the task list in rust-lang#29363:
* `AddrParseError` still doesn't have examples, but I wasn't quite sure how to do them; other `FromStr` error types don't have any, either
* I didn't link to an IETF RFC in `IpAddr`, but in `Ipv4Addr` and `Ipv6Addr` and linked tho those from `IpAddr`; this seems more appropriate to me
* Similarly, I didn't really exand `SocketAddr`'s docs, but elaborated on `SocketAddrV4` and `SocketAddrV6`'s and linked to them from `SocketAddr`

Theres definitely still room for improvement, but this should be a good first effort 😄
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools E-help-wanted Call for participation: Help is requested to fix this issue. E-medium Call for participation: Medium difficulty. Experience needed to fix: Intermediate. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. P-medium Medium priority
Projects
None yet
Development

No branches or pull requests

3 participants