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

Redesign the I/O library and traits #4248

Closed
19 of 28 tasks
brson opened this issue Dec 21, 2012 · 4 comments
Closed
19 of 28 tasks

Redesign the I/O library and traits #4248

brson opened this issue Dec 21, 2012 · 4 comments
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot. metabug Issues about issues themselves ("bugs about bugs")
Milestone

Comments

@brson
Copy link
Contributor

brson commented Dec 21, 2012

It is desperately needed. Some requirements:

  • Default implementations must not ever block the Rust scheduler
  • Should support posix streams, files, sockets, etc.
  • Should support streams built around uv (non blocking)

Work items:

Completeness

@brson
Copy link
Contributor Author

brson commented Feb 19, 2013

Related to #4419

@brson
Copy link
Contributor Author

brson commented May 30, 2013

Some useful comments in #2004

bors added a commit that referenced this issue Oct 24, 2013
Large topics:

* Implemented `rt::io::net::unix`. We've got an implementation backed by "named pipes" for windows for free from libuv, so I'm not sure if these should be `cfg(unix)` or whether they'd be better placed in `rt::io::pipe` (which is currently kinda useless), or to leave in `unix`. Regardless, we probably shouldn't deny windows of functionality which it certainly has.
* Fully implemented `net::addrinfo`, or at least fully implemented in the sense of making the best attempt to wrap libuv's `getaddrinfo` api
* Moved standard I/O to a libuv TTY instead of just a plain old file descriptor. I found that this interacted better when closing stdin, and it has the added bonus of getting things like terminal dimentions (someone should make a progress bar now!)
* Migrate to `~Trait` instead of a typedef'd object where possible. There are only two more types which are blocked on this, and those are traits which have a method which takes by-value self (there's an open issue on this)
* Drop `rt::io::support::PathLike` in favor of just `ToCStr`. We recently had a lot of Path work done, but it still wasn't getting passed down to libuv (there was an intermediate string conversion), and this allows true paths to work all the way down to libuv (and anything else that can become a C string).
* Removes `extra::fileinput` and `extra::io_util`


Closes #9895 
Closes #9975
Closes #8330
Closes #6850 (ported lots of libraries away from std::io)
cc #4248 (implemented unix/dns)
cc #9128 (made everything truly trait objects)
bors added a commit that referenced this issue Oct 24, 2013
Large topics:

* Implemented `rt::io::net::unix`. We've got an implementation backed by "named pipes" for windows for free from libuv, so I'm not sure if these should be `cfg(unix)` or whether they'd be better placed in `rt::io::pipe` (which is currently kinda useless), or to leave in `unix`. Regardless, we probably shouldn't deny windows of functionality which it certainly has.
* Fully implemented `net::addrinfo`, or at least fully implemented in the sense of making the best attempt to wrap libuv's `getaddrinfo` api
* Moved standard I/O to a libuv TTY instead of just a plain old file descriptor. I found that this interacted better when closing stdin, and it has the added bonus of getting things like terminal dimentions (someone should make a progress bar now!)
* Migrate to `~Trait` instead of a typedef'd object where possible. There are only two more types which are blocked on this, and those are traits which have a method which takes by-value self (there's an open issue on this)
* Drop `rt::io::support::PathLike` in favor of just `ToCStr`. We recently had a lot of Path work done, but it still wasn't getting passed down to libuv (there was an intermediate string conversion), and this allows true paths to work all the way down to libuv (and anything else that can become a C string).
* Removes `extra::fileinput` and `extra::io_util`


Closes #9895 
Closes #9975
Closes #8330
Closes #6850 (ported lots of libraries away from std::io)
cc #4248 (implemented unix/dns)
cc #9128 (made everything truly trait objects)
@alexcrichton
Copy link
Member

I'm going to take a bold move and call this done.

The I/O rewrite has been essentially complete for many months now, and we've gotten a lot of good experience with it. The implementation is entirely filled out for libgreen, and mostly filled out for libnative. Error handling has been settled on (#11946). Performance has been quite good in both the native and green cases.

There are still a few bugs hanging off this metabug, but they're all nominated/milestone'd properly anyway.

@brson
Copy link
Contributor Author

brson commented Feb 6, 2014

\o/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. E-hard Call for participation: Hard difficulty. Experience needed to fix: A lot. metabug Issues about issues themselves ("bugs about bugs")
Projects
None yet
Development

No branches or pull requests

2 participants