Skip to content

Commit

Permalink
collections: anchor for host-functions (env), used in impl
Browse files Browse the repository at this point in the history
  • Loading branch information
dj8yf0μl committed Feb 17, 2025
1 parent 793694c commit b69de5c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
11 changes: 11 additions & 0 deletions near-sdk/src/collections/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! ## General description
//!
//! Collections that offer an alternative to standard containers from `std::collections::*` by
//! utilizing the underlying blockchain trie storage more efficiently.
//!
Expand Down Expand Up @@ -33,6 +35,15 @@
//!
//! The efficiency of `LookupMap` comes at the cost, since it has fewer methods than `HashMap` and is not
//! that seamlessly integrated with the rest of the Rust standard library.
//!
//! ## Calls to host-functions, used in implementation:
//!
//! * [`near_sdk::env::storage_write`](crate::env::storage_write)
//! * [`near_sdk::env::storage_read`](crate::env::storage_read)
//! * [`near_sdk::env::storage_remove`](crate::env::storage_remove)
//! * [`near_sdk::env::storage_get_evicted`](crate::env::storage_get_evicted)
//! * [`near_sdk::env::storage_has_key`](crate::env::storage_has_key)
//!
mod legacy_tree_map;
#[allow(deprecated)]
Expand Down
12 changes: 6 additions & 6 deletions near-sdk/src/store/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
//! the container's `flush` method, e.g. [`IterableMap::flush`](crate::store::IterableMap::flush) ([`IterableMap::drop`](crate::store::IterableMap::drop) uses it in implementation too).
//!
//! ```rust,no_run
//! # use near_sdk::{log, near, env};
//! # use near_sdk::{log, near};
//! use near_sdk::store::IterableMap;
//!
//! #[near(contract_state)]
Expand All @@ -44,7 +44,7 @@
//! pub fn mutating_method(&mut self, argument: String) {
//! self.greeting_map.insert("greeting".into(), argument);
//! env::log_str(&format!("State of contract mutated: {:#?}", self));
//! near_sdk::env::log_str(&format!("State of contract mutated: {:#?}", self));
//! }
//! }
//! // expanded #[near] macro call on a contract method definition:
Expand Down Expand Up @@ -90,10 +90,10 @@
//!
//! ## Calls to host-functions, used in implementation:
//!
//! * [`env::storage_write`](crate::env::storage_write)
//! * [`env::storage_read`](crate::env::storage_read)
//! * [`env::storage_remove`](crate::env::storage_remove)
//! * [`env::storage_has_key`](crate::env::storage_has_key)
//! * [`near_sdk::env::storage_write`](crate::env::storage_write)
//! * [`near_sdk::env::storage_read`](crate::env::storage_read)
//! * [`near_sdk::env::storage_remove`](crate::env::storage_remove)
//! * [`near_sdk::env::storage_has_key`](crate::env::storage_has_key)
//!
//! ## Module's glossary:
//!
Expand Down

0 comments on commit b69de5c

Please sign in to comment.