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
The #[doc(alias = "...")] attribute became stable in Rust 1.48, and an interesting usecase for the feature was presented in this blog post. Libraries that wrap over an FFI interface (like nvml-wrapper does) can use the attribute to make it easier for developers used to working with the C library to transition to the Rust wrapper by enabling them to search for the C function names directly.
As an example, the following wrapper function in nvml-wrapper:
The
#[doc(alias = "...")]
attribute became stable in Rust 1.48, and an interesting usecase for the feature was presented in this blog post. Libraries that wrap over an FFI interface (likenvml-wrapper
does) can use the attribute to make it easier for developers used to working with the C library to transition to the Rust wrapper by enabling them to search for the C function names directly.As an example, the following wrapper function in
nvml-wrapper
:should be annotated with the following attribute:
So that it's possible to search for the C function name and find the equivalent method in the Rust wrapper.
I'd be happy to accept a PR adding usages of this attribute around the wrapper!
The text was updated successfully, but these errors were encountered: