Trait artichoke_backend::core::File[][src]

pub trait File {
    type Artichoke;
    type Error;
    fn require(interp: &mut Self::Artichoke) -> Result<(), Self::Error>;

Rust extension hook that can be required.

Files are mounted in the interpreter filesystem and can modify interpreter state when they are loaded.

Associated Types

type Artichoke[src]

Concrete type for interpreter.

type Error[src]

Concrete error type for eval functions.

Loading content...

Required methods

fn require(interp: &mut Self::Artichoke) -> Result<(), Self::Error>[src]

Called when the filename mapped to this type is required by the VM.

This function can mutate interpreter state, such as defining classes and modules. This function is equivalent to the “init” methods of C-implemented Rubygems.


If a fallible API on the interpreter returns an error, implementors should return an error. Example fallible APIs that might be called on require include Eval::eval and LoadSources::def_rb_source_file.

Loading content...


Loading content...