Skip to main content

ModuleType

Trait ModuleType 

Source
pub trait ModuleType<'a, C> {
    type Error;

    // Required method
    fn compile_line(
        ctx: &mut C,
        string: &'a str,
    ) -> Result<Func<'a>, Self::Error>;

    // Provided method
    fn compile(
        ctx: &mut C,
        string: &'a str,
    ) -> Result<Script<'a>, (usize, Self::Error)> { ... }
}
Expand description

Types which implement ModuleType can compile a line into a Func and multiple lines into a Script

Required Associated Types§

Required Methods§

Source

fn compile_line(ctx: &mut C, string: &'a str) -> Result<Func<'a>, Self::Error>

Provided Methods§

Source

fn compile( ctx: &mut C, string: &'a str, ) -> Result<Script<'a>, (usize, Self::Error)>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'a, C> ModuleType<'a, C> for Nil

Source§

impl<'a, H, T, C> ModuleType<'a, C> for Cons<H, T>
where H: 'a + Match<'a, C> + Callable, T: ModuleType<'a, C, Error = MatchError>, <T as ModuleType<'a, C>>::Error: Into<MatchError>,