Struct std::old_io::ChanWriterUnstable [-] [+] [src]

pub struct ChanWriter {
    // some fields omitted
}

Allows writing to a tx.

Example

fn main() { #![allow(unused_must_use)] use std::sync::mpsc::channel; use std::old_io::ChanWriter; let (tx, rx) = channel(); drop(rx); let mut writer = ChanWriter::new(tx); writer.write("hello, world".as_bytes()); }
use std::sync::mpsc::channel;
use std::old_io::ChanWriter;

let (tx, rx) = channel();
let mut writer = ChanWriter::new(tx);
writer.write("hello, world".as_bytes());

Methods

impl ChanWriter

fn new(tx: Sender<Vec<u8>>) -> ChanWriter

Wraps a channel in a ChanWriter structure

Trait Implementations

impl Clone for ChanWriter

fn clone(&self) -> ChanWriter

fn clone_from(&mut self, source: &Self)

impl Writer for ChanWriter

fn write_all(&mut self, buf: &[u8]) -> IoResult<()>

fn write(&mut self, buf: &[u8]) -> IoResult<()>

fn flush(&mut self) -> IoResult<()>

fn write_fmt(&mut self, fmt: Arguments) -> IoResult<()>

fn write_str(&mut self, s: &str) -> IoResult<()>

fn write_line(&mut self, s: &str) -> IoResult<()>

fn write_char(&mut self, c: char) -> IoResult<()>

fn write_int(&mut self, n: isize) -> IoResult<()>

fn write_uint(&mut self, n: usize) -> IoResult<()>

fn write_le_uint(&mut self, n: usize) -> IoResult<()>

fn write_le_int(&mut self, n: isize) -> IoResult<()>

fn write_be_uint(&mut self, n: usize) -> IoResult<()>

fn write_be_int(&mut self, n: isize) -> IoResult<()>

fn write_be_u64(&mut self, n: u64) -> IoResult<()>

fn write_be_u32(&mut self, n: u32) -> IoResult<()>

fn write_be_u16(&mut self, n: u16) -> IoResult<()>

fn write_be_i64(&mut self, n: i64) -> IoResult<()>

fn write_be_i32(&mut self, n: i32) -> IoResult<()>

fn write_be_i16(&mut self, n: i16) -> IoResult<()>

fn write_be_f64(&mut self, f: f64) -> IoResult<()>

fn write_be_f32(&mut self, f: f32) -> IoResult<()>

fn write_le_u64(&mut self, n: u64) -> IoResult<()>

fn write_le_u32(&mut self, n: u32) -> IoResult<()>

fn write_le_u16(&mut self, n: u16) -> IoResult<()>

fn write_le_i64(&mut self, n: i64) -> IoResult<()>

fn write_le_i32(&mut self, n: i32) -> IoResult<()>

fn write_le_i16(&mut self, n: i16) -> IoResult<()>

fn write_le_f64(&mut self, f: f64) -> IoResult<()>

fn write_le_f32(&mut self, f: f32) -> IoResult<()>

fn write_u8(&mut self, n: u8) -> IoResult<()>

fn write_i8(&mut self, n: i8) -> IoResult<()>