-
Notifications
You must be signed in to change notification settings - Fork 262
Add map support #1562
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
base: main
Are you sure you want to change the base?
Add map support #1562
Changes from all commits
0a302d8
8ac1f50
90c5adb
5d1a055
c08547b
a3fb574
f5ba29d
a814c14
43a7fd6
ee6a8b0
a9a8dd6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
yordis marked this conversation as resolved.
Show resolved
Hide resolved
|
yordis marked this conversation as resolved.
Show resolved
Hide resolved
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,6 +67,11 @@ pub mod bitflags { | |
| pub use crate::bitflags; | ||
| } | ||
|
|
||
| #[cfg(feature = "std")] | ||
| pub type Map<K, V> = std::collections::HashMap<K, V>; | ||
| #[cfg(not(feature = "std"))] | ||
| pub type Map<K, V> = alloc::collections::BTreeMap<K, V>; | ||
|
Comment on lines
+70
to
+73
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This I'm hesitant to do myself, specifically switching based on One possibility perhaps is to force some sort of configuration in
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @alexcrichton honestly, I do not feel qualify to decide, until now, I have been "pattern matching" and coding based on the List type. Digging more into Rust details, here is the finding thus far based on AI, so I need to triple verify, I may delay this topic and try to make things to work first, and swap this later I think WIT key types are constrained. Keys in a WIT map won't be arbitrary Rust types -- they'll be primitives, strings, enums, or simple records. All of these naturally implement It provides real map semantics. Unlike It works everywhere. Configuration can come later. A The one thing I'd avoid is So my suggestion: keep |
||
|
|
||
| /// For more information about this see `./ci/rebuild-libwit-bindgen-cabi.sh`. | ||
| #[cfg(not(target_env = "p2"))] | ||
| mod wit_bindgen_cabi_realloc; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.