Open
Description
Looking at this example snippet
#[extendr(use_try_from = true)]
fn with_optional_input(#[default = "NULL"] idx : Nullable<Integers>) -> Integers {
match idx {
NotNull(x) => x,
Null => (0..5).collect::<Integers>() /* do not remember the syntax */
}
}
Source: extendr/extendr.github.io#27
Here #[extendr]
macro has a field attribute that is not #[extendr(default = "NULL")]
.
I believe including the macro name in the attribute is standard practice, to avoid collisions with other macros.
See https://serde.rs/field-attrs.html as an example
Metadata
Metadata
Assignees
Labels
No labels