pub struct Builtin {
pub name: &'static str,
pub desc: &'static str,
pub func: &'static dyn Fn(&mut Environment, &[ConValue]) -> IResult<ConValue>,
}
Expand description
A function built into the interpreter.
Fields§
§name: &'static str
An identifier to be used during registration
desc: &'static str
The signature, displayed when the builtin is printed
func: &'static dyn Fn(&mut Environment, &[ConValue]) -> IResult<ConValue>
The function to be run when called
Implementations§
Trait Implementations§
Source§impl Callable for Builtin
impl Callable for Builtin
Source§fn 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
The Callable is responsible for checking the argument count and validating types
impl Copy for Builtin
Auto Trait Implementations§
impl Freeze for Builtin
impl !RefUnwindSafe for Builtin
impl !Send for Builtin
impl !Sync for Builtin
impl Unpin for Builtin
impl !UnwindSafe for Builtin
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more