Trait artichoke_backend::prelude::Io[][src]

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

Make I/O external to the interpreter.

Associated Types

type Error[src]

Concrete error type for errors encountered when reading and writing.

Loading content...

Required methods

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

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>(&mut self, message: T) -> Result<(), Self::Error> where
    T: AsRef<[u8]>, 
[src]

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

impl Io for Artichoke[src]

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

Writes the given bytes to the interpreter stdout stream.

This implementation delegates to the underlying output strategy.

Errors

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

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

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

This implementation delegates to the underlying output strategy.

Errors

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

type Error = Error

Loading content...