pub trait Callable {
// Required methods
fn call(
&self,
interpreter: &mut Environment,
args: &[ConValue],
) -> IResult<ConValue>;
fn name(&self) -> Option<Sym>;
}Expand description
Callable types can be called from within a Conlang program
Required Methods§
Sourcefn call(
&self,
interpreter: &mut Environment,
args: &[ConValue],
) -> IResult<ConValue>
fn call( &self, interpreter: &mut Environment, args: &[ConValue], ) -> IResult<ConValue>
Calls this Callable in the provided Environment, with ConValue args
The Callable is responsible for checking the argument count and validating types
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".