Skip to content

Commit

Permalink
scratch that, just add a method that we need
Browse files Browse the repository at this point in the history
Signed-off-by: William Casarin <[email protected]>
  • Loading branch information
jb55 committed Jul 16, 2024
1 parent a503cb2 commit 3f88c7b
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,15 @@ impl FilterBuilder {
self.start_tags_field('p');
}

pub fn start_tag_field(&mut self, tag: char) {
fn start_tag_field(&mut self, tag: char) {
unsafe { bindings::ndb_filter_start_tag_field(self.as_mut_ptr(), tag as u8 as c_char) };
}

pub fn end_field(&mut self) {
fn end_field(&mut self) {
unsafe { bindings::ndb_filter_end_field(self.as_mut_ptr()) }
}

pub fn events(&mut self, events: Vec<[u8; 32]>) -> &mut Self {
pub fn events(&mut self, events: Vec<&[u8; 32]>) -> &mut Self {
self.start_tag_field('e');
for ref id in events {
self.add_id_element(id);
Expand All @@ -187,6 +187,13 @@ impl FilterBuilder {
self
}

pub fn event(&mut self, id: &[u8; 32]) -> &mut Self {
self.start_tag_field('e');
self.add_id_element(id);
self.end_field();
self
}

pub fn ids(&mut self, ids: Vec<[u8; 32]>) -> &mut Self {
self.start_ids_field();
for ref id in ids {
Expand Down

0 comments on commit 3f88c7b

Please sign in to comment.