Skip to content

Disable priv in std::comm::Port, etc #10562

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

Merged
merged 1 commit into from
Dec 6, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/libstd/comm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,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();
Expand Down Expand Up @@ -158,7 +159,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> {
Expand Down Expand Up @@ -200,7 +201,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> {
Expand Down