Trait artichoke_backend::class_registry::ClassRegistry[][src]

pub trait ClassRegistry {
    fn def_class<T>(&mut self, spec: Spec) -> Result<(), Error>
    where
        T: Any
;
fn class_spec<T>(&self) -> Result<Option<&Spec>, Error>
    where
        T: Any
;
fn class_of<T>(&mut self) -> Result<Option<Value>, Error>
    where
        T: Any
;
fn new_instance<T>(
        &mut self,
        args: &[Value]
    ) -> Result<Option<Value>, Error>
    where
        T: Any
; fn is_class_defined<T>(&self) -> bool
    where
        T: Any
, { ... } }

Required methods

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

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

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

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

Loading content...

Provided methods

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

Loading content...

Implementors

impl ClassRegistry for Artichoke[src]

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

Create a class definition bound to a Rust type T.

Class definitions have the same lifetime as the State because the class def owns the mrb_data_type for the type, which must be long-lived.

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

Retrieve a class definition from the state bound to Rust type T.

This function returns None if type T has not had a class spec registered for it using ClassRegistry::def_class.

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

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

Loading content...