This commit is contained in:
2025-02-12 09:47:32 -05:00
commit d2e6c51073
13 changed files with 1332 additions and 0 deletions

33
src/output.rs Normal file
View File

@@ -0,0 +1,33 @@
// output trait and some possibilities for outputs
pub trait Output {
fn write(&mut self, data : &str);
}
pub struct DummyOutput {
out : String
}
impl Output for DummyOutput {
fn write(&mut self, data : &str) {
self.out += data;
}
}
impl DummyOutput {
pub fn print(&mut self) {
println!("{}", self.out);
}
pub fn spool(self) -> String {
self.out
}
pub fn new() -> DummyOutput {
DummyOutput {
out : String::new()
}
}
}