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: #[near(contract_state)] doc should link to [store] and [collections] modules #1304

Open
dj8yfo opened this issue Feb 8, 2025 · 2 comments
Assignees

Comments

@dj8yfo
Copy link
Collaborator

dj8yfo commented Feb 8, 2025

There should be links from #[near(contract_state)] to modules themselves and to anchors of modules' documentation with all [env] host-functions used in storage implementation.

Links from [store] and [collections] to host-functions in [env] used in storage implementation intersect with scope of #1265


Relates to #1299

Should create links mentioned below in comment #1304 (comment) and also add this sub-heading to #[near(contract_state)] heading:

/// ### FAQ
/// * unlike containers in [`collections`] module, most containers in [`store`] module will cache all changes
///   and loads and only update values that are changed in storage after it’s dropped through it’s [`Drop`](core::ops::Drop) implementation.
///   These changes can be updated in storage before the container variable is dropped by using
///   the container's `flush` method, e.g. [`store::Vector::flush`] ([`store::Vector::drop`] uses this in implementation too).
/// 
@kcmikee
Copy link

kcmikee commented Feb 9, 2025

I’d like to resolve this.

@dj8yfo
Copy link
Collaborator Author

dj8yfo commented Feb 10, 2025

@kcmikee this is a copy of screenshot from #1265

Image

Headings with used [env] host-functions should be created in [store] and [collections] module-level documentation.
Then 4 links from #[near(contract_state)] attribute documentation:

  1. [store] module.
  2. store module doc heading/anchor with above [env] functions
  3. [collections] module
  4. collections module doc heading/anchor with above [env] functions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: NEW❗
Development

No branches or pull requests

2 participants