diff --git a/src/ndb.rs b/src/ndb.rs index 5e3f462..ecb04d2 100644 --- a/src/ndb.rs +++ b/src/ndb.rs @@ -142,6 +142,23 @@ impl Ndb { Ok(()) } + pub fn process_client_event(&self, json: &str) -> Result<()> { + // Convert the Rust string to a C-style string + let c_json = CString::new(json).expect("CString::new failed"); + let c_json_ptr = c_json.as_ptr(); + + // Get the length of the string + let len = json.len() as libc::c_int; + + let res = unsafe { bindings::ndb_process_client_event(self.as_ptr(), c_json_ptr, len) }; + + if res == 0 { + return Err(Error::NoteProcessFailed); + } + + Ok(()) + } + pub fn query<'a>( &self, txn: &'a Transaction,