(request: &StoredRequest)
| 95 | } |
| 96 | |
| 97 | fn decode<M: Message + Default + DeserializeOwned>(request: &StoredRequest) -> Result<M> { |
| 98 | let body = std::fs::read(&request.path)?; |
| 99 | Ok(match request.encoding { |
| 100 | Encoding::Protobuf => M::decode(body.as_slice())?, |
| 101 | Encoding::Json => serde_json::from_slice(&body)?, |
| 102 | }) |
| 103 | } |
| 104 | |
| 105 | /// Removes the artifact already at its path, and only creates its artifact on the first rows. |
| 106 | struct LazyWriter<R: TelemetryRow> { |