Skip to content

Commit

Permalink
doc: add IterableMap and IterableSet to store module glossary
Browse files Browse the repository at this point in the history
Fixes near#1283

### Description
Adds missing documentation for `IterableMap` and `IterableSet` collections to the store module's glossary documentation.

### Changes
- Added `IterableMap` entry to Maps section explaining its performance characteristics and benefits
- Added `IterableSet` entry to Sets section highlighting its optimized iteration capabilities
- Maintained consistent documentation style with other collections

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/near/near-sdk-rs/issues/1283?shareId=XXXX-XXXX-XXXX-XXXX).
  • Loading branch information
TobieTom committed Feb 15, 2025
1 parent 1f3c071 commit c8559d2
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions near-sdk/src/store/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//! Collections and types used when interacting with storage.
//!
//! These collections are more scalable versions of [`std::collections`] when used as contract
//! state because it allows values to be lazily loaded and stored based on what is actually
//! These collections are more scalable versions of [`std::collections`] when used as contract
//! state because it allows values to be lazily loaded and stored based on what is actually
//! interacted with.
//!
//! Fundamentally, a contract's storage is a key/value store where both keys and values are just
Expand Down Expand Up @@ -52,6 +50,11 @@
//! - [`UnorderedMap`]: Storage version of [`std::collections::HashMap`]. No ordering
//! guarantees.
//!
//! - [`IterableMap`]: A performant iterable key-value storage implementation that addresses iteration
//! performance degradation with high number of elements. Unlike [`UnorderedMap`], it maintains
//! consistently fast iteration performance by optimizing the underlying storage structure, using
//! an optimized vector for keys alongside a lookup map for values.
//!
//! - [`TreeMap`] (`unstable`): Storage version of [`std::collections::BTreeMap`]. Ordered by key,
//! which comes at the cost of more expensive lookups and iteration.
//!
Expand All @@ -62,6 +65,10 @@
//! - [`UnorderedSet`]: Analogous to [`std::collections::HashSet`], and is an iterable
//! version of [`LookupSet`] and persisted to storage.
//!
//! - [`IterableSet`]: A performant iterable set implementation optimized for high-volume iteration.
//! Uses separate storage for fast element lookup and a vector for optimized iteration, making it
//! ideal for cases where you need to frequently iterate over large sets of data.
//!
//! Basic Types:
//!
//! - [`Lazy<T>`](Lazy): Lazily loaded type that can be used in place of a type `T`.
Expand Down

0 comments on commit c8559d2

Please sign in to comment.