[][src]Trait artichoke_backend::module_registry::ModuleRegistry

pub trait ModuleRegistry {
    pub fn def_module<T>(&mut self, spec: Spec) -> Result<(), Error>
    where
        T: Any
;
pub fn module_spec<T>(&self) -> Result<Option<&Spec>, Error>
    where
        T: Any
;
pub fn module_of<T>(&mut self) -> Result<Option<Value>, Error>
    where
        T: Any
; pub fn is_module_defined<T>(&self) -> bool
    where
        T: Any
, { ... } }

Required methods

pub fn def_module<T>(&mut self, spec: Spec) -> Result<(), Error> where
    T: Any
[src]

pub fn module_spec<T>(&self) -> Result<Option<&Spec>, Error> where
    T: Any
[src]

pub fn module_of<T>(&mut self) -> Result<Option<Value>, Error> where
    T: Any
[src]

Loading content...

Provided methods

pub fn is_module_defined<T>(&self) -> bool where
    T: Any
[src]

Loading content...

Implementors

impl ModuleRegistry for Artichoke[src]

pub fn def_module<T>(&mut self, spec: Spec) -> Result<(), Error> where
    T: Any
[src]

Create a module definition bound to a Rust type T.

Module definitions have the same lifetime as the interpreter because the module def owns the mrb_data_type for the type, which must be long-lived.

pub fn module_spec<T>(&self) -> Result<Option<&Spec>, Error> where
    T: Any
[src]

Retrieve a module definition from the interpreter bound to Rust type T.

This function returns None if type T has not had a module spec registered for it using ModuleRegistry::def_module.

Loading content...