pub trait Io { type Error; fn print(&mut self, message: &[u8]) -> Result<(), Self::Error>; fn puts(&mut self, message: &[u8]) -> Result<(), Self::Error> { ... } }
Perform I/O external to the interpreter.
Concrete error type for errors encountered when reading and writing.
Writes the given bytes to the interpreter stdout stream.
If the output stream encounters an error, an error is returned.
Writes the given bytes to the interpreter stdout stream followed by a newline.
The default implementation uses two calls to print.
print