मैं जंग में हैशमैप शाब्दिक कैसे बना सकता हूं? अजगर में मैं इसे ऐसा कर सकते हैं:मैं हैश मैप शाब्दिक कैसे बना सकता हूं?
hashmap = {
'element0': {
'name': 'My New Element',
'childs': {
'child0': {
'name': 'Child For Element 0',
'childs': {
...
}
}
}
},
...
}
इस तरह
और जाओ में:
type Node struct {
name string
childs map[string]Node
}
hashmap := map[string]Node {
"element0": Node{
"My New Element",
map[string]Node {
'child0': Node{
"Child For Element 0",
map[string]Node {}
}
}
}
}
'grabbag_macros' crate में भी एक है। आप यहां स्रोत देख सकते हैं: https://github.com/DanielKeep/rust-grabbag/blob/master/grabbag_macros/src/lib.rs#L3-L64। –