feat(nix-compat/nar/reader): async support

This is a first cut at the async NAR reader, with some rough edges.
Poisoning is left unimplemented for now, pending future work.

Change-Id: Ifaafe0581a5e0e165a13357b909fb441f7bd8bab
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11524
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
This commit is contained in:
edef 2024-04-29 16:44:45 +00:00
parent 343e176bec
commit 08feea4817
6 changed files with 566 additions and 1 deletions

View file

@ -33,7 +33,7 @@ const LEN_SIZE: usize = 8;
///
/// This buffers the entire payload into memory,
/// a streaming version is available at [crate::wire::bytes::BytesReader].
pub async fn read_bytes<R>(
pub async fn read_bytes<R: ?Sized>(
r: &mut R,
allowed_size: RangeInclusive<usize>,
) -> std::io::Result<Vec<u8>>