MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / read_request_roundtrip

Function read_request_roundtrip

nodedb/src/control/promql/remote_proto.rs:220–238  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

218
219 #[test]
220 fn read_request_roundtrip() {
221 let req = ReadRequest {
222 queries: vec![Query {
223 start_timestamp_ms: 0,
224 end_timestamp_ms: 10000,
225 matchers: vec![LabelMatcher {
226 match_type: MatchType::Eq as i32,
227 name: "__name__".into(),
228 value: "up".into(),
229 }],
230 }],
231 };
232
233 let mut buf = Vec::new();
234 req.encode(&mut buf).unwrap();
235 let decoded = ReadRequest::decode(&buf[..]).unwrap();
236 assert_eq!(decoded.queries.len(), 1);
237 assert_eq!(decoded.queries[0].matchers[0].value, "up");
238 }
239}

Callers

nothing calls this directly

Calls 2

decodeFunction · 0.50
encodeMethod · 0.45

Tested by

no test coverage detected