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

Function streaming_encoder

nodedb-codec/src/lz4.rs:374–385  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

372
373 #[test]
374 fn streaming_encoder() {
375 let parts = [b"hello ".as_ref(), b"world".as_ref(), b" test".as_ref()];
376 let full: Vec<u8> = parts.iter().flat_map(|p| p.iter().copied()).collect();
377
378 let mut enc = Lz4Encoder::new();
379 for part in &parts {
380 enc.push(part);
381 }
382 let encoded = enc.finish();
383 let decoded = decode(&encoded).unwrap();
384 assert_eq!(decoded, full);
385 }
386
387 #[test]
388 fn custom_block_size() {

Callers

nothing calls this directly

Calls 6

collectMethod · 0.80
decodeFunction · 0.70
as_refMethod · 0.45
iterMethod · 0.45
pushMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected