pub trait Module<'a, C> {
type Error;
// Required method
fn compile_line(
&self,
ctx: &mut C,
string: &'a str,
) -> Result<Func<'a>, Self::Error>;
// Provided method
fn compile(
&self,
ctx: &mut C,
string: &'a str,
) -> Result<Script<'a>, (usize, Self::Error)> { ... }
}
Expand description
Types which implement Module
can compile a line into a Func
and multiple lines into a
Script
through instance methods