diff --git a/src/ndb.rs b/src/ndb.rs index 406f70c..9db888d 100644 --- a/src/ndb.rs +++ b/src/ndb.rs @@ -117,6 +117,18 @@ impl Ndb { } } + pub fn unsubscribe(&self, sub_id: u64) -> Result<()> { + let r = unsafe { + bindings::ndb_unsubscribe(self.as_ptr(), sub_id) + }; + + if r == 0 { + Err(Error::SubscriptionError) + } else { + Ok(()) + } + } + pub fn subscribe(&self, filters: Vec) -> Result { unsafe { let mut ndb_filters: Vec =