Skip to content

Commit 9e201f1

Browse files
uefi-macros: Update unsafe_protocol docstring
1 parent bff410a commit 9e201f1

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

uefi-macros/src/lib.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@ macro_rules! err {
2525

2626
/// Attribute macro for marking structs as UEFI protocols.
2727
///
28-
/// The macro takes one argument, either a GUID string or the path to a `Guid`
29-
/// constant.
28+
/// The macro can only be applied to a struct, and takes one argument, either a
29+
/// GUID string or the path to a `Guid` constant.
3030
///
31-
/// The macro can only be applied to a struct. It implements the
32-
/// [`Protocol`] trait and the `unsafe` [`Identify`] trait for the
33-
/// struct.
31+
/// The macro implements the [`Protocol`] trait and the `unsafe` [`Identify`]
32+
/// trait for the struct. This allows a protocol to be opened with
33+
/// [`boot::open_protocol`] or [`boot::open_protocol_exclusive`]. Note that this
34+
/// trait does not automatically install a protocol. To install a protocol, call
35+
/// [`boot::install_protocol_interface`].
3436
///
3537
/// # Safety
3638
///
@@ -55,9 +57,12 @@ macro_rules! err {
5557
/// assert_eq!(ExampleProtocol2::GUID, PROTO_GUID);
5658
/// ```
5759
///
58-
/// [`Identify`]: https://docs.rs/uefi/latest/uefi/trait.Identify.html
60+
/// [`Identify`]: https://docs.rs/uefi/latest/uefi/data_types/trait.Identify.html
5961
/// [`Protocol`]: https://docs.rs/uefi/latest/uefi/proto/trait.Protocol.html
6062
/// [send-and-sync]: https://doc.rust-lang.org/nomicon/send-and-sync.html
63+
/// [`boot::open_protocol`]: https://docs.rs/uefi/latest/uefi/boot/fn.open_protocol.html
64+
/// [`boot::open_protocol_exclusive`]: https://docs.rs/uefi/latest/uefi/boot/fn.open_protocol_exclusive.html
65+
/// [`boot::install_protocol_interface`]: https://docs.rs/uefi/latest/uefi/boot/fn.install_protocol_interface.html
6166
#[proc_macro_attribute]
6267
pub fn unsafe_protocol(args: TokenStream, input: TokenStream) -> TokenStream {
6368
let expr = parse_macro_input!(args as Expr);

0 commit comments

Comments
 (0)