File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -226,14 +226,15 @@ pub struct CompileTimeEnv {
226226Builtins are functions provided by the compiler/VM and the only functions available.
227227
228228``` rust
229- pub struct BuiltinFn {
230- // Needs to follow identifier naming rules
231- pub name : String ,
232- // Arguments the function expects
233- pub args : Vec <FnArg >,
229+ pub struct BuiltinFn <'a > {
230+ /// Needs to follow identifier naming rules
231+ pub name : & 'static str ,
232+ /// Arguments the function expects
233+ pub args : & 'a [FnArg ],
234+ /// Type returned by the function
234235 pub return_type : Type ,
235- // Function used at runtime
236- pub func : std :: rc :: Rc < dyn Fn (Vec <Value >) -> Value >,
236+ /// Function used at runtime
237+ pub func : fn (Vec <Value >) -> ExprResult < Value >,
237238}
238239
239240pub struct FnArg {
Original file line number Diff line number Diff line change @@ -31,12 +31,13 @@ impl FnArg {
3131#[ derive( Clone ) ]
3232/// Builtin function used in expressions
3333pub struct BuiltinFn < ' a > {
34- // Needs to follow identifier naming rules
34+ /// Needs to follow identifier naming rules
3535 pub name : & ' static str ,
36- // Arguments the function expects
36+ /// Arguments the function expects
3737 pub args : & ' a [ FnArg ] ,
38+ /// Type returned by the function
3839 pub return_type : Type ,
39- // Function used at runtime
40+ /// Function used at runtime
4041 pub func : fn ( Vec < Value > ) -> ExprResult < Value > ,
4142}
4243
You can’t perform that action at this time.
0 commit comments