Closed nymoral closed 7 months ago
Bindings from callback interface result in compile error: ./worker.go:717:70: could not determine kind of name for C.worker_78d8_cgo_UniFfiHttpClient
./worker.go:717:70: could not determine kind of name for C.worker_78d8_cgo_UniFfiHttpClient
[Error] enum ClientError { "InternalError", }; callback interface UniFFIHttpClient { [Throws=ClientError] i32 post(string path, sequence<string> header, string body_b64); }; namespace worker { u32 worker_start( boolean compression, UniFFIHttpClient ffi_client ); };
uniffi::include_scaffolding!("worker"); #[derive(Debug, thiserror::Error)] pub enum ClientError { #[error("Internal error occurred")] InternalError, } impl From<uniffi::UnexpectedUniFFICallbackError> for ClientError { fn from(_: uniffi::UnexpectedUniFFICallbackError) -> Self { ClientError::InternalError } } pub trait UniFFIHttpClient: Send + Sync { fn post(&self, path: String, headers: Vec<String>, body_b64: String) -> Result<i32, ClientError>; } pub fn worker_start( compression: bool, ffi_client: Box<dyn UniFFIHttpClient>, ) -> u32 { return 0; }
Bindings from callback interface result in compile error:
./worker.go:717:70: could not determine kind of name for C.worker_78d8_cgo_UniFfiHttpClient