Skip to content

Commit

Permalink
add ndb_unsubscribe
Browse files Browse the repository at this point in the history
Signed-off-by: William Casarin <[email protected]>
  • Loading branch information
jb55 committed Jul 22, 2024
1 parent c86355d commit c2343b5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/ndb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Filter>) -> Result<Subscription> {
unsafe {
let mut ndb_filters: Vec<bindings::ndb_filter> =
Expand Down

0 comments on commit c2343b5

Please sign in to comment.