On 07/08/2013 06:43 AM, Josh Leverette wrote:

extern mod std;
extern mod extra;
use std::{task, io};
use extra::flatpipes;

fn main() {
    let (port, chan) = flatpipes::serial::pipe_stream();
    let portBox = ~port;
    do task::spawn || {
        let val = portBox.recv();
        io::println(fmt!("Value: %?", val));
    }
    let value = @[1, 2, 3, 4, 5];
    chan.send(value);
}

The problem is that an @-box was added to the PipeBytePort type, which makes it unsendable, so at the moment flatpipe ports cannot be sent. Channels are still sendable. Here's the definition in question:

    pub struct PipeBytePort {
        port: comm::Port<~[u8]>,
        buf: @mut ~[u8]
    }

_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to