use std::marker::PhantomData; pub trait Callback { type CallbackFunc; } #[derive(Copy, Clone)] #[repr(C)] pub struct CallbackPtr { callback_ptr: *const (), func: T::CallbackFunc, _marker: PhantomData, } impl CallbackPtr { pub unsafe fn from_raw(data: T, func: T::CallbackFunc) -> Self { todo!() } pub fn func(&self) -> &T::CallbackFunc { &self.func } }