We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9db89e7 commit c2e5cceCopy full SHA for c2e5cce
core-foundation-sys/src/base.rs
@@ -80,6 +80,23 @@ pub struct CFAllocatorContext {
80
pub preferredSize: CFAllocatorPreferredSizeCallBack
81
}
82
83
+/// Trait for all types which are Core Foundation reference types.
84
+pub unsafe trait TCFReference {
85
+ fn as_void_ptr(&self) -> *const c_void;
86
+
87
+ fn from_void_ptr(ptr: *const c_void) -> Self;
88
+}
89
90
+unsafe impl<T> TCFReference for *const T {
91
+ fn as_void_ptr(&self) -> *const c_void {
92
+ (*self) as *const c_void
93
+ }
94
95
+ fn from_void_ptr(ptr: *const c_void) -> Self {
96
+ ptr as *const T
97
98
99
100
extern {
101
/*
102
* CFBase.h
0 commit comments