Struct indexed_db::Index
source · pub struct Index<Err> { /* private fields */ }
Expand description
Wrapper for IDBIndex
,
for use in transactions
Implementations§
source§impl<Err> Index<Err>
impl<Err> Index<Err>
sourcepub fn count_in(
&self,
range: impl RangeBounds<JsValue>
) -> impl Future<Output = Result<usize, Err>>
pub fn count_in( &self, range: impl RangeBounds<JsValue> ) -> impl Future<Output = Result<usize, Err>>
Count all the keys (for this index) in the provided range
Internally, this uses IDBIndex::count
.
sourcepub fn get(
&self,
key: &[&JsValue]
) -> impl Future<Output = Result<Option<JsValue>, Err>>
pub fn get( &self, key: &[&JsValue] ) -> impl Future<Output = Result<Option<JsValue>, Err>>
Get the object with key key
for this index
Internally, this uses IDBIndex::get
.
sourcepub fn get_first_in<'a>(
&self,
range: impl RangeBounds<[&'a JsValue]>
) -> impl Future<Output = Result<Option<JsValue>, Err>>
pub fn get_first_in<'a>( &self, range: impl RangeBounds<[&'a JsValue]> ) -> impl Future<Output = Result<Option<JsValue>, Err>>
Get the first value with a key (for this index) in range
, ordered by key (for this index)
Note that the unbounded range is not a valid range for IndexedDB.
Internally, this uses IDBIndex::get
.
sourcepub fn get_all(
&self,
limit: Option<u32>
) -> impl Future<Output = Result<Vec<JsValue>, Err>>
pub fn get_all( &self, limit: Option<u32> ) -> impl Future<Output = Result<Vec<JsValue>, Err>>
Get all the objects in the store, ordered by this index, with a maximum number of results of limit
Internally, this uses IDBIndex::getAll
.
sourcepub fn get_all_in<'a>(
&self,
range: impl RangeBounds<[&'a JsValue]>,
limit: Option<u32>
) -> impl Future<Output = Result<Vec<JsValue>, Err>>
pub fn get_all_in<'a>( &self, range: impl RangeBounds<[&'a JsValue]>, limit: Option<u32> ) -> impl Future<Output = Result<Vec<JsValue>, Err>>
Get all the objects with a key (for this index) in the provided range, with a maximum number of
results of limit
, ordered by this index
Internally, this uses IDBIndex::getAll
.
sourcepub fn get_first_key_in<'a>(
&self,
range: impl RangeBounds<[&'a JsValue]>
) -> impl Future<Output = Result<Option<JsValue>, Err>>
pub fn get_first_key_in<'a>( &self, range: impl RangeBounds<[&'a JsValue]> ) -> impl Future<Output = Result<Option<JsValue>, Err>>
Get the first existing key (for this index) in the provided range
Internally, this uses IDBIndex::getKey
.
sourcepub fn get_all_keys(
&self,
limit: Option<u32>
) -> impl Future<Output = Result<Vec<JsValue>, Err>>
pub fn get_all_keys( &self, limit: Option<u32> ) -> impl Future<Output = Result<Vec<JsValue>, Err>>
List all the keys in the object store, with a maximum number of results of limit
, ordered by this index
Internally, this uses IDBIndex::getAllKeys
.
sourcepub fn get_all_keys_in<'a>(
&self,
range: impl RangeBounds<[&'a JsValue]>,
limit: Option<u32>
) -> impl Future<Output = Result<Vec<JsValue>, Err>>
pub fn get_all_keys_in<'a>( &self, range: impl RangeBounds<[&'a JsValue]>, limit: Option<u32> ) -> impl Future<Output = Result<Vec<JsValue>, Err>>
List all the keys (for this index) in the provided range, with a maximum number of results of limit
,
ordered by this index
Internally, this uses IDBIndex::getAllKeys
.