(value: Option<&serde_json::Value>)
| 302 | } |
| 303 | |
| 304 | fn metadata_score(value: Option<&serde_json::Value>) -> f32 { |
| 305 | value |
| 306 | .and_then(serde_json::Value::as_f64) |
| 307 | .map(|score| (score as f32).clamp(0.0, 1.0)) |
| 308 | .unwrap_or(0.0) |
| 309 | } |
| 310 | |
| 311 | /// Result from a context provider query |
| 312 | #[derive(Debug, Clone, Default, Serialize, Deserialize)] |