File tree 2 files changed +13
-0
lines changed
2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 1
1
# uefi - [ Unreleased]
2
2
3
+ ## Added
4
+ - Added ` Handle::new `
3
5
4
6
# uefi - 0.31.0 (2024-08-21)
5
7
Original file line number Diff line number Diff line change @@ -13,6 +13,17 @@ use core::ptr::{self, NonNull};
13
13
pub struct Handle ( NonNull < c_void > ) ;
14
14
15
15
impl 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
+
16
27
/// Creates a new [`Handle`] from a raw address. The address might
17
28
/// come from the Multiboot2 information structure or something similar.
18
29
///
You can’t perform that action at this time.
0 commit comments