Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • You can do matching on strings, but that's not at all "like a python dict". What you seem to need is a hashmap. Commented Oct 1, 2019 at 9:14
  • If those links don't answer your problem, please explain your need and build a minimal reproducible example. Commented Oct 1, 2019 at 9:16
  • 3
    Note that rust is a strongly typed language. Your code sample can hardly make sense. Commented Oct 1, 2019 at 9:22
  • Do you want to store some created struct to a dictionary and then retrieve them from it? Or you just want to create and return these struct like you share on the question? Commented Oct 1, 2019 at 10:16