You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reflect::library! macro currently only accepts functions as trait functions or associated functions. We'll also need to work with free functions like str::from_utf8 that are not part of a trait or impl block.
Along similar lines it would be useful to be able to create new freestanding functions as well. This could be done by declaring the function upfront in the reflect::library, and calling make_function like this:
But it would probably be more convenient to just have a make_new_function method. I'm not exactly sure how it would look like, but maybe something along these lines:
let new_function = ex.make_new_function("new_function_name");
new_function.add_param(Type::primitive_str().reference());
new_function.add_param(Type::from_str("Struct").unwrap());
ex.make_function(new_function, new_function_impl)fnnew_function_impl(/*..*/){/*..*/}
The reflect::library! macro currently only accepts functions as trait functions or associated functions. We'll also need to work with free functions like str::from_utf8 that are not part of a trait or impl block.
The text was updated successfully, but these errors were encountered: