MCPcopy Create free account
hub / github.com/CodSpeedHQ/codspeed / decode

Function decode

src/instruments/otel/artifacts.rs:97–103  ·  view source on GitHub ↗
(request: &StoredRequest)

Source from the content-addressed store, hash-verified

95}
96
97fn 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.
106struct LazyWriter<R: TelemetryRow> {

Callers

nothing calls this directly

Calls 1

readFunction · 0.70

Tested by

no test coverage detected