use crate::{ result::{Error, Result}, FfiSlice, FfiSliceRef, }; use super::{ObjectABI, VTable}; #[repr(C)] pub struct Setting { inner: (), vtable: &'static VTable, } impl ObjectABI for Setting { type VTable = SettingVTable; } pub struct SettingVTable { pub serialize: unsafe extern "C" fn(this: Setting) -> Result, Error>, pub deserialize: unsafe extern "C" fn(buffer: FfiSliceRef<[u8]>) -> Result, } impl SettingVTable { pub fn new() -> Self { todo!() } } pub trait IntoSettingVTable { unsafe extern "C" fn serialize(this: Setting) -> Result, Error>; unsafe extern "C" fn deserialize(buffer: FfiSliceRef<[u8]>) -> Result; }