I'm assuming you're after a way to do this in Rust.
Rust's analogue to a Python dictionary is a HashMap.
Unlike Python's dictionaries HashMaps are statically typed (i.e. all the keys must have the same type, and all the values must also share the same type) – to create a new HashMap you want something like:
use std::collections::HashMap;
fn main() {
let mut hashmap: HashMap<String, i32> = HashMap::new();
hashmap.insert("one".to_string(), 1);
for (key, value) in hashmap {
println!("{} {}", key, value);
}
}
Which outputs:
one 1
Playground link
If you want to load the object from Python into Rust, there are a couple of options
for (i, j) in data(iandjare owned values) orfor (r, s) in &data(randsare references)