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

Function assert_codec

libs/@local/harpc/wire-protocol/src/codec/decode.rs:129–137  ·  view source on GitHub ↗
(value: &T, context: T::Context)

Source from the content-addressed store, hash-verified

127
128 #[track_caller]
129 pub(crate) fn assert_codec<T>(value: &T, context: T::Context)
130 where
131 T: Debug + PartialEq + Decode + Encode,
132 {
133 let bytes = encode_value(value);
134 let decoded = decode_value(bytes, context);
135
136 assert_eq!(*value, decoded);
137 }
138
139 #[test]
140 fn decode_u16() {

Callers 15

codec_versionFunction · 0.85
codec_protocolFunction · 0.85
encode_decodeFunction · 0.85
codec_idFunction · 0.85
encode_decodeFunction · 0.85
codecFunction · 0.85
encode_decodeFunction · 0.85
codec_idFunction · 0.85
codecFunction · 0.85
codecFunction · 0.85
codecFunction · 0.85
codecFunction · 0.85

Calls 2

encode_valueFunction · 0.85
decode_valueFunction · 0.85

Tested by

no test coverage detected