[][src]Trait artichoke_backend::extn::prelude::Eval

pub trait Eval {
    type Value: Value;
    type Error: Error;
    fn eval(&mut self, code: &[u8]) -> Result<Self::Value, Self::Error>;
fn eval_os_str(&mut self, code: &OsStr) -> Result<Self::Value, Self::Error>; }

Execute code and retrieve its result.

Associated Types

type Value: Value

Concrete type for return values from eval.

type Error: Error

Concrete error type for eval functions.

Loading content...

Required methods

fn eval(&mut self, code: &[u8]) -> Result<Self::Value, Self::Error>

Eval code on the Artichoke interpreter using the current Context.

Errors

If an exception is raised on the interpreter, then an error is returned.

fn eval_os_str(&mut self, code: &OsStr) -> Result<Self::Value, Self::Error>

Eval code on the Artichoke interpreter using the current Context when given code as an [OsStr].

Errors

If an exception is raised on the interpreter, then an error is returned.

If code cannot be converted to a &[u8] on the current platform, then an error is returned.

Loading content...

Implementors

impl Eval for Artichoke[src]

type Value = Value

type Error = Exception

Loading content...