Skip to content

Instantly share code, notes, and snippets.

@experquisite
Created January 1, 2016 20:45
Show Gist options
  • Save experquisite/1aadc1640458eefbce48 to your computer and use it in GitHub Desktop.
Save experquisite/1aadc1640458eefbce48 to your computer and use it in GitHub Desktop.
use std::io::{stdout, Stdout, Write};
use std::sync::mpsc;
struct SpaceLogHandler<X> {
read_channel: mpsc::Receiver<X>,
write_channel: mpsc::Sender<X>,
handler: Box<std::io::Write>,
}
impl<X> SpaceLogHandler<X> {
fn new() -> SpaceLogHandler<X>{
let (tx, rx) = mpsc::channel::<X>();
return SpaceLogHandler::<X> {
read_channel: rx,
write_channel: tx,
handler: Box::new(std::io::stdout()),
};
}
}
fn main() {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment