]> git.lizzy.rs Git - rust.git/commit
Implement native::IoFactory
authorAlex Crichton <alex@alexcrichton.com>
Tue, 12 Nov 2013 22:38:28 +0000 (14:38 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Thu, 14 Nov 2013 02:34:59 +0000 (18:34 -0800)
commit9bcf557589a385d163c6d543ede82953b09e072f
treefa03002e7054bde23c9712637f78914806e16454
parent1bfa45cfd9d7c8b2dcc0ea7a42396624e8b5a31b
Implement native::IoFactory

This commit re-organizes the io::native module slightly in order to have a
working implementation of rtio::IoFactory which uses native implementations. The
goal is to seamlessly multiplex among libuv/native implementations wherever
necessary.

Right now most of the native I/O is unimplemented, but we have existing bindings
for file descriptors and processes which have been hooked up. What this means is
that you can now invoke println!() from libstd with no local task, no local
scheduler, and even without libuv.

There's still plenty of work to do on the native I/O factory, but this is the
first steps into making it an official portion of the standard library. I don't
expect anyone to reach into io::native directly, but rather only std::io
primitives will be used. Each std::io interface seamlessly falls back onto the
native I/O implementation if the local scheduler doesn't have a libuv one
(hurray trait ojects!)
13 files changed:
src/librustuv/macros.rs
src/libstd/io/mod.rs
src/libstd/io/native/file.rs
src/libstd/io/native/mod.rs [new file with mode: 0644]
src/libstd/io/native/process.rs
src/libstd/io/native/stdio.rs [deleted file]
src/libstd/io/stdio.rs
src/libstd/rt/basic.rs
src/libstd/rt/rtio.rs
src/libstd/rt/util.rs
src/test/bench/shootout-k-nucleotide-pipes.rs
src/test/run-pass/native-print-no-runtime.rs [new file with mode: 0644]
src/test/run-pass/native-print-no-uv.rs [new file with mode: 0644]