pub trait OutputAdapter: Send + Sync {
// Required methods
fn print(&mut self, result: PrintResult) -> ValueWord;
fn clone_box(&self) -> Box<dyn OutputAdapter>;
}Expand description
Trait for handling print() output
Different execution modes can provide different adapters:
- Scripts: StdoutAdapter (print and discard spans)
- REPL: ReplAdapter (print and preserve spans for reformatting)
- Tests: MockAdapter (capture output)
Required Methods§
Sourcefn print(&mut self, result: PrintResult) -> ValueWord
fn print(&mut self, result: PrintResult) -> ValueWord
Sourcefn clone_box(&self) -> Box<dyn OutputAdapter>
fn clone_box(&self) -> Box<dyn OutputAdapter>
Clone the adapter (for trait object cloning)