Skip to main content

deserialize_unordered_array

Function deserialize_unordered_array 

Source
pub fn deserialize_unordered_array<'de, T, D>(
    deserializer: D,
) -> Result<Vec<T>, D::Error>
where D: Deserializer<'de>, T: Deserialize<'de>,
Expand description

Helper to deserialize a PHP array where the keys might be out of order.

§Caveat

Holes in the array will not be filled in. The following PHP array

$arr = array();
$arr[0] = "zero";
$arr[2] = "two";
$arr[1] = "one";
$arr[6] = "six";

will be deserialized to a Rust Vec with the four elements “zero”, “one”, “two”, and “six”.