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

Key- and value-only iteration #1834

Merged
merged 12 commits into from
Aug 28, 2023
Merged

Key- and value-only iteration #1834

merged 12 commits into from
Aug 28, 2023

Conversation

chipshort
Copy link
Collaborator

@chipshort chipshort commented Aug 24, 2023

Closes #1498

This completes step 1, the first half of step 2 and step 4 of the corresponding issue.

The rest is tbd in wasmvm.

Copy link
Member

@webmaster128 webmaster128 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great start. Now what is missing is a contract using those imports. This would be implementing ExternalStorage::range_keys and ExternalStorage::range_values manually through the C imports

packages/vm/src/compatibility.rs Outdated Show resolved Hide resolved
packages/vm/src/compatibility.rs Outdated Show resolved Hide resolved
packages/vm/src/backend.rs Show resolved Hide resolved
packages/vm/src/backend.rs Show resolved Hide resolved
packages/vm/src/imports.rs Outdated Show resolved Hide resolved
packages/check/src/main.rs Outdated Show resolved Hide resolved
chipshort and others added 3 commits August 24, 2023 12:04
Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com>
@chipshort chipshort force-pushed the 1498-key-only-iteration branch 2 times, most recently from 39701b5 to 9d97558 Compare August 24, 2023 16:11
Copy link
Member

@webmaster128 webmaster128 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice. We just need a CHANGELOG entry here

struct ExternalPartialIterator {
iterator_id: u32,
partial_type: PartialType,
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking about implementing Iterator for the enum directly:

enum ExternalPartialIterator {
    Keys { iterator_id: u32 },
    Values { iterator_id: u32 },
}

However, I don't see any strong benefit and it makes it harder to add fields, so feel free to ignore if not useful.

CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com>
@chipshort chipshort merged commit f541c2b into main Aug 28, 2023
3 checks passed
@chipshort chipshort deleted the 1498-key-only-iteration branch August 28, 2023 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Key-only iteration
2 participants