Skip to content

Commit 0e3bc2a

Browse files
committed
uefi: Enable access to OpenProtocolParams
1 parent 429f13b commit 0e3bc2a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Diff for: uefi/src/boot.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -1536,6 +1536,14 @@ pub struct ScopedProtocol<P: Protocol + ?Sized> {
15361536
open_params: OpenProtocolParams,
15371537
}
15381538

1539+
impl<P: Protocol + ?Sized> ScopedProtocol<P> {
1540+
/// Returns the [`OpenProtocolParams`] used to open the [`ScopedProtocol`].
1541+
#[must_use]
1542+
pub const fn open_params(&self) -> OpenProtocolParams {
1543+
self.open_params
1544+
}
1545+
}
1546+
15391547
impl<P: Protocol + ?Sized> Drop for ScopedProtocol<P> {
15401548
fn drop(&mut self) {
15411549
let bt = boot_services_raw_panicking();
@@ -1667,7 +1675,7 @@ pub enum OpenProtocolAttributes {
16671675
}
16681676

16691677
/// Parameters passed to [`open_protocol`].
1670-
#[derive(Debug)]
1678+
#[derive(Clone, Copy, Debug)]
16711679
pub struct OpenProtocolParams {
16721680
/// The handle for the protocol to open.
16731681
pub handle: Handle,

0 commit comments

Comments
 (0)