Constructors for flat pipes that send POD types using memcpy.
This module is currently unsafe because it uses Copy Owned
as a type parameter bounds meaning POD (plain old data), but Copy Owned
and POD are not equivelant.
PipeChan
PipePort
ReaderPort
WriterChan
pipe_chan
- Create a FlatChan
from a Chan<~[u8]>
pipe_port
- Create a FlatPort
from a Port<~[u8]>
pipe_stream
- Create a pair of FlatChan
and FlatPort
, backed by pipesreader_port
- Create a FlatPort
from a Reader
writer_chan
- Create a FlatChan
from a Writer
PipeChan
type PipeChan<T: Copy Owned> = FlatChan<T, PodFlattener<T>, PipeByteChan>
PipePort
type PipePort<T: Copy Owned> = FlatPort<T, PodUnflattener<T>, PipeBytePort>
ReaderPort
type ReaderPort<T: Copy Owned, R> = FlatPort<T, PodUnflattener<T>, ReaderBytePort<R>>
WriterChan
type WriterChan<T: Copy Owned, W> = FlatChan<T, PodFlattener<T>, WriterByteChan<W>>
pipe_chan
fn pipe_chan<T: Copy Owned>(chan: Chan<~[u8]>) -> PipeChan<T>
Create a FlatChan
from a Chan<~[u8]>
pipe_port
fn pipe_port<T: Copy Owned>(port: Port<~[u8]>) -> PipePort<T>
Create a FlatPort
from a Port<~[u8]>
pipe_stream
fn pipe_stream<T: Copy Owned>() -> (PipePort<T>, PipeChan<T>)
Create a pair of FlatChan
and FlatPort
, backed by pipes
reader_port
fn reader_port<T: Copy Owned, R: Reader>(reader: R) -> ReaderPort<T, R>
Create a FlatPort
from a Reader
writer_chan
fn writer_chan<T: Copy Owned, W: Writer>(writer: W) -> WriterChan<T, W>
Create a FlatChan
from a Writer