Created
May 28, 2014 00:42
-
-
Save wycats/1d8df86e531bf0b99ae1 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
extern crate term; | |
use term::Terminal; | |
enum AdequateTerminal<T> { | |
Color(Box<Terminal<T>>) | |
} | |
struct Shell<T> { | |
terminal: AdequateTerminal<T> | |
} | |
impl <T: Writer + Send> Shell<T> { | |
fn create(out: T) -> Option<Shell<T>> { | |
let term: Option<term::TerminfoTerminal<T>> = Terminal::new(out); | |
term.map(|t: term::TerminfoTerminal<T>| Shell::<T> { terminal: Color(box t) }) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment