Skip to content

Commit

Permalink
feat: Add missing get_all_with_key_and_limit method
Browse files Browse the repository at this point in the history
Closes #31
  • Loading branch information
Alorel committed Jul 26, 2024
1 parent 6d0c8b9 commit 3375562
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/idb_query_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,26 @@ pub trait IdbQuerySource: Sized {
self.get_all_with_key(&key.into())
}

/// Get all values in the index/object store that correspond to the given key or are in
/// range, if the key is an [`IDBKeyRange`](web_sys::IdbKeyRange). `limit` controls the
/// maximum number of results to return
fn get_all_with_key_and_limit<K: JsCast>(
&self,
key: &K,
limit: u32,
) -> Result<JsCastRequestFuture<js_sys::Array>, DomException>;

/// Get all values in the index/object store that correspond to the given key or are in
/// range, if the key is an [`IDBKeyRange`](web_sys::IdbKeyRange). `limit` controls the
/// maximum number of results to return
fn get_all_with_key_and_limit_owned<K: Into<JsValue>>(
&self,
key: K,
limit: u32,
) -> Result<JsCastRequestFuture<js_sys::Array>, DomException> {
self.get_all_with_key_and_limit(&key.into(), limit)
}

/// Count the number of documents in the index/object store
fn count(&self) -> Result<CountFuture, DomException>;

Expand Down

0 comments on commit 3375562

Please sign in to comment.