nostrdb-rs

nostrdb in rust!
git clone git://jb55.com/nostrdb-rs
Log | Files | Refs | Submodules | README | LICENSE

commit 0e3dda62be295c3c28b3343f9a143d3d73148906
parent 8e747888819b0af0a2e86ac5736dbe6fbf661c07
Author: Yuki Kishimoto <yukikishimoto@protonmail.com>
Date:   Mon,  8 Apr 2024 11:12:49 +0200

Add `FilterBuilder::until` method

Signed-off-by: Yuki Kishimoto <yukikishimoto@protonmail.com>

Diffstat:
Msrc/filter.rs | 11+++++++++++
1 file changed, 11 insertions(+), 0 deletions(-)

diff --git a/src/filter.rs b/src/filter.rs @@ -142,6 +142,10 @@ impl FilterBuilder { self.start_field(bindings::ndb_filter_fieldtype_NDB_FILTER_SINCE); } + fn start_until_field(&mut self) { + self.start_field(bindings::ndb_filter_fieldtype_NDB_FILTER_UNTIL); + } + fn start_limit_field(&mut self) { self.start_field(bindings::ndb_filter_fieldtype_NDB_FILTER_LIMIT); } @@ -237,6 +241,13 @@ impl FilterBuilder { self } + pub fn until(&mut self, until: u64) -> &mut Self { + self.start_until_field(); + self.add_int_element(until); + self.end_field(); + self + } + pub fn limit(&mut self, limit: u64) -> &mut Self { self.start_limit_field(); self.add_int_element(limit);