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
When building a C API for an existing crate with a Rust centric API. You often write wrapper functions that wrap the Rust API into something suitable for C, e.g. boxing stuff into raw pointers, error handling, etc. I would be nice to be able to specify that cbindgen should copy the documentation comment of another item when generating the header so you can copy it from the original wrapped item without duplicating the comment in the code.
The text was updated successfully, but these errors were encountered:
Have same issue and tried a workaround that I expected to work. However cbindgen is not adding the contents of #[doc = include_str!("sample.md")] when applied to an enum variant, while a comment like /// sample is added to the enum variant definition in the C language output. I think the doc include string may be the most directly supported way in Rust to copy doc comments, whether or not an IDE supports it for tooltips?
However then I'd get into the issue of whether or not the target language supports Markdown in code comments.
When building a C API for an existing crate with a Rust centric API. You often write wrapper functions that wrap the Rust API into something suitable for C, e.g. boxing stuff into raw pointers, error handling, etc. I would be nice to be able to specify that cbindgen should copy the documentation comment of another item when generating the header so you can copy it from the original wrapped item without duplicating the comment in the code.
The text was updated successfully, but these errors were encountered: