diff options
| author | bors <bors@rust-lang.org> | 2013-12-05 15:16:27 -0800 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-12-05 15:16:27 -0800 |
| commit | 55353137a64b186f15e7f7e7d714297b7a8b6b02 (patch) | |
| tree | 5813794ad45d3beeba336333c1bdf00a339834c0 /src/libstd/comm.rs | |
| parent | ad6f6cb589f1b796598fcb0f1b95d71956d5e6a5 (diff) | |
| parent | 7304326ff91b6ad2d43e9a6fc4cc4a2c5ecf94c0 (diff) | |
| download | rust-55353137a64b186f15e7f7e7d714297b7a8b6b02.tar.gz rust-55353137a64b186f15e7f7e7d714297b7a8b6b02.zip | |
auto merge of #10562 : ongardie/rust/master, r=brson
It's useful to allow users to get at the internal std::rc::comm::Port, and other such fields, since they implement important traits like Select. See [rust-dev] "select on std::comm::Port and different types" at https://mail.mozilla.org/pipermail/rust-dev/2013-November/006735.html for background.
Diffstat (limited to 'src/libstd/comm.rs')
| -rw-r--r-- | src/libstd/comm.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/libstd/comm.rs b/src/libstd/comm.rs index fcba4a6bbdb..c5ed464de23 100644 --- a/src/libstd/comm.rs +++ b/src/libstd/comm.rs @@ -81,16 +81,17 @@ pub trait Peekable<T> { fn peek(&self) -> bool; } -pub struct PortOne<T> { priv x: rtcomm::PortOne<T> } -pub struct ChanOne<T> { priv x: rtcomm::ChanOne<T> } +/* priv is disabled to allow users to get at traits like Select. */ +pub struct PortOne<T> { /* priv */ x: rtcomm::PortOne<T> } +pub struct ChanOne<T> { /* priv */ x: rtcomm::ChanOne<T> } pub fn oneshot<T: Send>() -> (PortOne<T>, ChanOne<T>) { let (p, c) = rtcomm::oneshot(); (PortOne { x: p }, ChanOne { x: c }) } -pub struct Port<T> { priv x: rtcomm::Port<T> } -pub struct Chan<T> { priv x: rtcomm::Chan<T> } +pub struct Port<T> { /* priv */ x: rtcomm::Port<T> } +pub struct Chan<T> { /* priv */ x: rtcomm::Chan<T> } pub fn stream<T: Send>() -> (Port<T>, Chan<T>) { let (p, c) = rtcomm::stream(); @@ -184,7 +185,7 @@ impl<T: Send> Peekable<T> for Port<T> { } -pub struct SharedChan<T> { priv x: rtcomm::SharedChan<T> } +pub struct SharedChan<T> { /* priv */ x: rtcomm::SharedChan<T> } impl<T: Send> SharedChan<T> { pub fn new(c: Chan<T>) -> SharedChan<T> { @@ -226,7 +227,7 @@ impl<T: Send> Clone for SharedChan<T> { } } -pub struct SharedPort<T> { priv x: rtcomm::SharedPort<T> } +pub struct SharedPort<T> { /* priv */ x: rtcomm::SharedPort<T> } impl<T: Send> SharedPort<T> { pub fn new(p: Port<T>) -> SharedPort<T> { |
