MCPcopy Create free account
hub / github.com/hashintel/hash / encode_decode

Function encode_decode

libs/@local/harpc/codec/src/error.rs:180–191  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

178 // if we encode and decode the error, we should get the same error back
179 #[test]
180 fn encode_decode() {
181 let error = NetworkError::capture_error(&ExampleError);
182
183 let code = error.code();
184 let value = error.bytes();
185
186 let decoded =
187 NetworkError::try_from_parts(code, value.clone()).expect("encode/decode should work");
188
189 assert_eq!(decoded.code(), code);
190 assert_eq!(decoded.bytes(), value);
191 }
192}

Callers

nothing calls this directly

Calls 5

capture_errorFunction · 0.85
bytesMethod · 0.80
codeMethod · 0.45
expectMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected