Function
write_ecdc_header
(fo: tp.IO[bytes], metadata: tp.Any)
Source from the content-addressed store, hash-verified
| 21 | |
| 22 | |
| 23 | def write_ecdc_header(fo: tp.IO[bytes], metadata: tp.Any): |
| 24 | meta_dumped = json.dumps(metadata).encode('utf-8') |
| 25 | version = 0 |
| 26 | header = _encodec_header_struct.pack(_ENCODEC_MAGIC, version, len(meta_dumped)) |
| 27 | fo.write(header) |
| 28 | fo.write(meta_dumped) |
| 29 | fo.flush() |
| 30 | |
| 31 | |
| 32 | def _read_exactly(fo: tp.IO[bytes], size: int) -> bytes: |
Callers
nothing calls this directly
Tested by
no test coverage detected
Used in the wild real call sites across dependent graphs
searching dependent graphs…