use std::marker::PhantomData; use crate::{FfiValue, FfiValueMut}; #[repr(C)] pub struct FfiFuture { poll_fn: unsafe extern "C" fn(FfiValueMut>, FfiValueMut<()>) -> RuntimeFuturePoll, wake_fn: unsafe extern "C" fn(FfiValueMut>, FfiValueMut<()>), poll_state: FfiValue<()>, waker_state: Option>, _output_marker: PhantomData, } unsafe impl Send for FfiFuture where Output: Send {} unsafe impl Sync for FfiFuture where Output: Sync {} impl FfiFuture { /// Docs here! /// # SAFETY /// TODO :( pub unsafe fn poll(&mut self) -> RuntimeFuturePoll { todo!() } /// Docs here! /// # SAFETY /// TODO :( pub unsafe fn from_raw( _poll_fn: unsafe extern "C" fn( FfiValueMut>, FfiValueMut<()>, ) -> RuntimeFuturePoll, _poll_state: PS, ) -> Self { todo!() } /// Docs here! /// # SAFETY /// Very not in progress text :) pub unsafe fn write_waker( &mut self, _wake_fn: unsafe extern "C" fn(FfiValueMut>, FfiValueMut<()>), _waker_state: WS, ) { todo!() } } #[repr(C)] pub enum RuntimeFuturePoll { Ready(FfiValue<()>), Pending, }