[][src]Trait artichoke_core::io::Io

pub trait Io {
    type Error;
    fn print<T: AsRef<[u8]>>(&mut self, message: T) -> Result<(), Self::Error>;

    fn puts<T: AsRef<[u8]>>(&mut self, message: T) -> Result<(), Self::Error> { ... }
}

Make I/O external to the interpreter.

Associated Types

type Error

Concrete error type for errors encountered when reading and writing.

Loading content...

Required methods

fn print<T: AsRef<[u8]>>(&mut self, message: T) -> Result<(), Self::Error>

Writes the given bytes to the interpreter stdout stream.

Errors

If the output stream encounters an error, an error is returned.

Loading content...

Provided methods

fn puts<T: AsRef<[u8]>>(&mut self, message: T) -> Result<(), Self::Error>

Writes the given bytes to the interpreter stdout stream followed by a newline.

This default implementation uses two calls to Io::print.

Errors

If the output stream encounters an error, an error is returned.

Loading content...

Implementors

Loading content...