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

Typed bounds for iteration #23

Closed
uint opened this issue Apr 9, 2024 · 0 comments · Fixed by #34
Closed

Typed bounds for iteration #23

uint opened this issue Apr 9, 2024 · 0 comments · Fixed by #34

Comments

@uint
Copy link
Collaborator

uint commented Apr 9, 2024

The start and end parameters currently take byte strings. These should be keys.

For now, let's take the "partial" rather than "full" key. It's a much easier-to-use API and likely to be enough for most use cases. It shouldn't be difficult to redesign in the future if proven otherwise.

let my_map = Map<String, Map<String, Item<u32>>>;

let keys = my_map
    .access(&storage)
    .keys(Some("foo"), Some("bar"));                                   // partial
let keys = my_map
    .access(&storage)
    .keys(Some(("foo", ("xyzzy", ()))), Some(("bar", ("zzyxy", ())))); // full

Probably more a "good to have" than a "must" for the prototype.

@uint uint added this to the "Polished PoC" milestone Apr 9, 2024
@uint uint closed this as completed in #34 May 7, 2024
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 a pull request may close this issue.

1 participant