HashMap::mapToVector allows to build a vector from an hashmap.
In Rust, an iterator can be mapped into any type, the outcome
of the iteration is decided afterwards by a collect method.
In PHP, native functions like array_map preserves the initial type.
As such, HashMap::map returns an HashMap.
The mapToVector method allows to collect the mapped values into a vector.