rust backend: dict to HashMap