//! definitions for memory layout of an interface and how to init it
usestd::{ffi::c_void,marker::PhantomData,ptr::NonNull};/// the memory layout for a exposed source interface
#[repr(C)]pubstructInterface<T:Sync+Send>{vtable:NonNull<*const c_void>,
pub(crate)data: T,
marker:PhantomData<*mut T>, // should make it not sync
}impl<T:Sync+Send>Interface<T>{/// Creates a new [`Interface<T>`] from an array of associated functions and the data of the struct/interface.
pubconstfnnew(vtable:NonNull<*const c_void>, interface_data: T)->Self{Self{
vtable,
data: interface_data,
marker: PhantomData,}}}// TODO: add examples here or in some other place
/// used to created the interface layout before registering it
pubtraitAsInterface: Sized + Sync + Send {/// used to created the interface layout before registering it
fnto_interface(self)->Interface<Self>;}