Created
January 1, 2016 20:45
-
-
Save experquisite/1aadc1640458eefbce48 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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