Trait mica::CoreLibrary

source ·
pub trait CoreLibrary {
    fn define_nil(&mut self, builder: TypeBuilder<()>) -> TypeBuilder<()>;
    fn define_boolean(&mut self, builder: TypeBuilder<bool>) -> TypeBuilder<bool>;
    fn define_number(&mut self, builder: TypeBuilder<f64>) -> TypeBuilder<f64>;
    fn define_string(
        &mut self,
        builder: TypeBuilder<String>
    ) -> TypeBuilder<String>; fn define_list(
        &mut self,
        builder: TypeBuilder<Vec<RawValue>>
    ) -> TypeBuilder<Vec<RawValue>>; fn define_dict(&mut self, builder: TypeBuilder<Dict>) -> TypeBuilder<Dict>; fn load(&mut self, engine: &mut Engine) -> Result<(), Error>; }
Expand description

Definitions of basic types provided by a core library. This role is usually fulfilled by corelib.

Each function must return the original builder, possibly with functions added into it.

Required Methods§

Defines the Nil type using the given type builder.

Defines the Boolean type using the given type builder.

Defines the Number type using the given type builder.

Defines the String type using the given type builder.

Defines the List type using the given type builder.

Defines the Dict type using the given type builder.

Loads additional types into the engine once the fundamental types are built.

Implementors§