File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 11# uefi - [ Unreleased]
22
3+ ## Added
4+ - Added ` Handle::new `
35
46# uefi - 0.31.0 (2024-08-21)
57
Original file line number Diff line number Diff line change @@ -13,6 +13,17 @@ use core::ptr::{self, NonNull};
1313pub struct Handle ( NonNull < c_void > ) ;
1414
1515impl Handle {
16+ /// Creates a new [`Handle`].
17+ ///
18+ /// # Safety
19+ /// This function is unsafe because the caller must be sure that the pointer
20+ /// is valid. Otherwise, further operations on the object might result in
21+ /// undefined behaviour, even if the methods aren't marked as unsafe.
22+ #[ must_use]
23+ pub const unsafe fn new ( ptr : NonNull < c_void > ) -> Self {
24+ Self ( ptr)
25+ }
26+
1627 /// Creates a new [`Handle`] from a raw address. The address might
1728 /// come from the Multiboot2 information structure or something similar.
1829 ///
You can’t perform that action at this time.
0 commit comments