Reads a pid-keyed map whose keys arrive as strings. JSON object keys are always strings. serde_json's direct deserializer special-cases that and parses integer map keys, but a `#[serde(flatten)]` field is buffered into serde's internal `Content` first, and that path has no such special case — a `pid_t` key then fails with `invalid type: string`. See
(deserializer: D)
| 22 | /// |
| 23 | /// Only the read side needs this: serializing writes the same bytes either way. |
| 24 | fn pid_keys_from_strings<'de, V, D>(deserializer: D) -> Result<HashMap<pid_t, V>, D::Error> |
| 25 | where |
| 26 | V: Deserialize<'de>, |
| 27 | D: Deserializer<'de>, |
| 28 | { |
| 29 | HashMap::<String, V>::deserialize(deserializer)? |
| 30 | .into_iter() |
| 31 | .map(|(key, value)| { |
| 32 | let pid = key |
| 33 | .parse::<pid_t>() |
| 34 | .map_err(|_| D::Error::custom(format!("invalid pid key: {key}")))?; |
| 35 | Ok((pid, value)) |
| 36 | }) |
| 37 | .collect() |
| 38 | } |
| 39 | |
| 40 | /// The per-profile module artifacts: the deduplicated debug info, unwind data |
| 41 | /// and symbol tables extracted from the ELF modules the profiled processes |
nothing calls this directly
no outgoing calls
no test coverage detected