Description
I just looked up https://docs.rs/uefi/0.16.0/uefi/table/boot/struct.BootServices.html#method.find_handles and was surprised to find out that my imported uefi
crate didn't have a find_handles
function. I had to look into the source code to realize that find_handles
is only available when the "exts" feature is enabled.
docs.rs supports a syntax to specify the required features and make them part of the public documentation. An example is https://docs.rs/ntfs/0.2.0/ntfs/struct.NtfsTime.html#impl-TryFrom%3COffsetDateTime%3E
Steps required:
- Add a
package.metadata.docs.rs
section toCargo.toml
like https://github.com/ColinFinck/ntfs/blob/b0058b9b9a19bd6727a8be7ef603d1e4421255ed/Cargo.toml#L40-L42 - Enable the
doc_cfg
feature for the newly addeddocsrs
argument: https://github.com/ColinFinck/ntfs/blob/b0058b9b9a19bd6727a8be7ef603d1e4421255ed/src/lib.rs#L37 - Add a corresponding
cfg_attr
for everycfg(feature(...))
attribute: https://github.com/ColinFinck/ntfs/blob/b0058b9b9a19bd6727a8be7ef603d1e4421255ed/src/time.rs#L36
This works at least for impl
s and fn
s. I had no luck putting this in front of a pub use
clause, but this shouldn't be necessary here anyway.
Would be great to see that in the next version of uefi-rs on docs.rs :)