From what I can tell from the docs, there is no way to add prefixes to function parameters. I think it would be useful to be able to do so. My motivating example is Windows SAL
To clarify to C++ consumers what the Rust code expects. Out pointers, strings vs pointers, optional parameters, and others. So that I can transform a Rust decl like this:
struct SomeThing {
// Null-terminated string
_Field_z_ const char *name;
// Not null-terminated, the length is in the preceding field
uintptr_t len;
_Field_size_(len) const char *serial;
};
From what I can tell from the docs, there is no way to add prefixes to function parameters. I think it would be useful to be able to do so. My motivating example is Windows SAL
https://learn.microsoft.com/en-us/cpp/code-quality/understanding-sal?view=msvc-170
To clarify to C++ consumers what the Rust code expects. Out pointers, strings vs pointers, optional parameters, and others. So that I can transform a Rust decl like this:
into this C++ decl
What the annotation would look like, I'm not sure. Maybe something like
and to a lesser extent for struct decls, though it's not as important to me.
->