We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
As mentioned here by @davydog187:
This also brings up another issue, as far as I can tell, tuple structs and newtypes are not encodeable/decodeable
So the following should be possible:
#[derive(NifTuple)] pub struct Newtype(i64); #[derive(NifTuple)] pub struct TupleStruct(i64, i64, i64); #[derive(NifRecord)] #[tag = "newtype"] pub struct Newtype(i64); #[derive(NifRecord)] #[module = "tuplestruct"] pub struct TupleStruct(i64, i64, i64);
The text was updated successfully, but these errors were encountered:
While implementing this, I found a handy way to debug the quote output. This might be interesting to others as well:
#[proc_macro_derive(NifTuple, attributes(rustler))] pub fn nif_tuple(input: TokenStream) -> TokenStream { let ast = syn::parse(input).unwrap(); let tokens: TokenStream = tuple::transcoder_decorator(&ast).into(); panic!("{}", TokenStream::to_string(&tokens)); tokens }
This aborts code generation with a panic and prints the generated code.
Sorry, something went wrong.
evnu
Successfully merging a pull request may close this issue.
As mentioned here by @davydog187:
So the following should be possible:
The text was updated successfully, but these errors were encountered: