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

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

pub 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

pub 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]

type Error = Error

pub 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.

pub 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.

Loading content...