Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add extendr_fn_options parameter to rust_function() #252

Conversation

Ilia-Kosenkov
Copy link
Member

@Ilia-Kosenkov Ilia-Kosenkov commented Mar 8, 2023

  • Add extendr_fn_options (better name?) to rust_function(), which accepts a named list of scalar values, each translating to an option passed to #[extendr] attribute.
  • Maintain a list of known options, such as use_try_from, r_name, mod_name.
  • Raise warnings on unknown options.
  • Verify types of known options
  • Abort if type mismatch, if an option has NULL value, or if the name is malformed.

Closes #131

@Ilia-Kosenkov Ilia-Kosenkov changed the title Add extendr_fn_options parameter to rust_source() Add extendr_fn_options parameter to rust_function() Mar 8, 2023
@Ilia-Kosenkov Ilia-Kosenkov marked this pull request as ready for review March 8, 2023 21:38
R/function_options.R Outdated Show resolved Hide resolved
R/function_options.R Show resolved Hide resolved
R/function_options.R Outdated Show resolved Hide resolved
R/function_options.R Outdated Show resolved Hide resolved
R/function_options.R Outdated Show resolved Hide resolved
R/function_options.R Outdated Show resolved Hide resolved
R/function_options.R Outdated Show resolved Hide resolved
Co-authored-by: Michael Milton <ttmigueltt@gmail.com>
This reverts commit 898f180.
Copy link
Member

@multimeric multimeric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Some very good tests too.

tests/testthat/test-extendr_function_options.R Outdated Show resolved Hide resolved
tests/testthat/test-extendr_function_options.R Outdated Show resolved Hide resolved
Ilia-Kosenkov and others added 2 commits March 25, 2023 01:59
Co-authored-by: Michael Milton <ttmigueltt@gmail.com>
Co-authored-by: Michael Milton <ttmigueltt@gmail.com>
@Ilia-Kosenkov Ilia-Kosenkov merged commit fc3c70d into extendr:main Mar 25, 2023
@Ilia-Kosenkov Ilia-Kosenkov deleted the feature/Support-extendr-options-in-rust_function branch September 24, 2023 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support extendr options in rust_function()
2 participants