On 24/01/14 03:54, Brandon Sanderson wrote:
I would expect Channel::new() to create a channel object that either
lets me send and receive, or lets me get a source and sink to send and
receive with. Borrow rules may prevent this, but my point is that
Channel::new() would generally be expected to return a struct, and not
a tuple.
Yes. I think either:
* Channel should be a struct, created by Channel::new(), with
sender and receiver instances as fields (by whatever name) --
essentially, the tuple should become a struct, with better naming of
port and chan
* Channel should have a ChannelTrait implemention, with send() and
receive(), and should be created by Channel::new()
But from what Benjamin says below, it seems like the latter isn't necessary.
On Jan 23, 2014 7:29 PM, "Benjamin Striegel" <ben.strie...@gmail.com
<mailto:ben.strie...@gmail.com>> wrote:
This all seems a bit silly. A channel *is*, conceptually, a tuple
of a sender and a receiver. If I call Chan::new(), that's what I
expect to get. And Chan::open() doesn't map to anything that's as
intuitive.
--
Lee
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev