Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: add IterableMap and IterableSet to store module glossary #1309

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading