File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 6
6
- ` DevicePath::to_boxed ` , ` DevicePath::to_owned ` , and ` DevicePath::as_bytes `
7
7
- ` DevicePathInstance::to_boxed ` , ` DevicePathInstance::to_owned ` , and ` DevicePathInstance::as_bytes `
8
8
- ` DevicePathNode::data `
9
+ - Added ` Event::from_ptr ` , ` Event::as_ptr ` , and ` Handle::as_ptr ` .
9
10
10
11
### Changed
11
12
- Renamed ` LoadImageSource::FromFilePath ` to ` LoadImageSource::FromDevicePath `
Original file line number Diff line number Diff line change @@ -36,6 +36,12 @@ impl Handle {
36
36
// shorthand for "|ptr| Self(ptr)"
37
37
NonNull :: new ( ptr) . map ( Self )
38
38
}
39
+
40
+ /// Get the underlying raw pointer.
41
+ #[ must_use]
42
+ pub fn as_ptr ( & self ) -> * mut c_void {
43
+ self . 0 . as_ptr ( )
44
+ }
39
45
}
40
46
41
47
/// Handle to an event structure, guaranteed to be non-null.
@@ -56,6 +62,21 @@ impl Event {
56
62
pub const unsafe fn unsafe_clone ( & self ) -> Self {
57
63
Self ( self . 0 )
58
64
}
65
+
66
+ /// Create an `Event` from a raw pointer.
67
+ ///
68
+ /// # Safety
69
+ ///
70
+ /// The caller must ensure that the pointer is valid.
71
+ pub unsafe fn from_ptr ( ptr : * mut c_void ) -> Option < Self > {
72
+ NonNull :: new ( ptr) . map ( Self )
73
+ }
74
+
75
+ /// Get the underlying raw pointer.
76
+ #[ must_use]
77
+ pub fn as_ptr ( & self ) -> * mut c_void {
78
+ self . 0 . as_ptr ( )
79
+ }
59
80
}
60
81
61
82
/// Trait for querying the alignment of a struct.
You can’t perform that action at this time.
0 commit comments