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

Method parse

crates/runner-shared/src/unwind_data.rs:39–52  ·  view source on GitHub ↗
(reader: &[u8])

Source from the content-addressed store, hash-verified

37pub type UnwindData = UnwindDataV4;
38impl UnwindData {
39 pub fn parse(reader: &[u8]) -> anyhow::Result<Self> {
40 let compat: UnwindDataCompat = bincode::deserialize(reader)?;
41
42 match compat {
43 UnwindDataCompat::V1(_) => {
44 anyhow::bail!("Cannot parse V1 unwind data as V4 (breaking changes)")
45 }
46 UnwindDataCompat::V2(_) => {
47 anyhow::bail!("Cannot parse V2 unwind data as V4 (breaking changes)")
48 }
49 UnwindDataCompat::V3(v3) => Ok(v3.into()),
50 UnwindDataCompat::V4(v4) => Ok(v4),
51 }
52 }
53
54 pub fn save_to<P: AsRef<std::path::Path>>(&self, folder: P, key: &str) -> anyhow::Result<()> {
55 let path = folder.as_ref().join(format!("{key}.{UNWIND_FILE_EXT}"));

Callers 7

get_pr_numberFunction · 0.80
parse_for_memmap2Function · 0.80
into_perf_mapMethod · 0.80
into_unwind_dataMethod · 0.80
get_user_uid_gidFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected