rust/src/libstd/io
Alex Crichton a9c1152c4b std: Add a new top-level thread_local module
This commit removes the `std::local_data` module in favor of a new
`std::thread_local` module providing thread local storage. The module provides
two variants of TLS: one which owns its contents and one which is based on
scoped references. Each implementation has pros and cons listed in the
documentation.

Both flavors have accessors through a function called `with` which yield a
reference to a closure provided. Both flavors also panic if a reference cannot
be yielded and provide a function to test whether an access would panic or not.
This is an implementation of [RFC 461][rfc] and full details can be found in
that RFC.

This is a breaking change due to the removal of the `std::local_data` module.
All users can migrate to the new thread local system like so:

    thread_local!(static FOO: Rc<RefCell<Option<T>>> = Rc::new(RefCell::new(None)))

The old `local_data` module inherently contained the `Rc<RefCell<Option<T>>>` as
an implementation detail which must now be explicitly stated by users.

[rfc]: https://github.com/rust-lang/rfcs/pull/461
[breaking-change]
2014-11-23 23:37:16 -08:00
..
net Switch to purely namespaced enums 2014-11-17 07:35:51 -08:00
buffered.rs implement Writer for Vec<u8> 2014-11-18 01:09:46 -05:00
comm_adapters.rs Fix fallout from coercion removal 2014-11-17 22:41:33 +13:00
extensions.rs implement Writer for Vec<u8> 2014-11-18 01:09:46 -05:00
fs.rs Return proper errors with update_err 2014-11-17 19:18:26 +02:00
mem.rs implement Writer for Vec<u8> 2014-11-18 01:09:46 -05:00
mod.rs std: Stabilize std::fmt 2014-11-18 21:16:22 -08:00
pipe.rs Disable dubious pipe test 2014-11-20 17:19:25 -08:00
process.rs Fallout from libgreen and libnative removal 2014-11-20 17:19:24 -08:00
result.rs implement Writer for Vec<u8> 2014-11-18 01:09:46 -05:00
stdio.rs std: Add a new top-level thread_local module 2014-11-23 23:37:16 -08:00
tempfile.rs Make os::getcwd() return IoResult<Path> 2014-11-19 05:31:45 +09:00
test.rs Make os::getcwd() return IoResult<Path> 2014-11-19 05:31:45 +09:00
timer.rs Runtime removal: refactor timer 2014-11-08 20:40:39 -08:00
util.rs implement Writer for Vec<u8> 2014-11-18 01:09:46 -05:00