about summary refs log tree commit diff
path: root/tvix/nix-compat/src/wire/bytes/mod.rs (follow)
AgeCommit message (Collapse)AuthorFilesLines
12 days r/8088 refactor(nix-compat/wire/bytes): style fixesedef1-13/+10
Change-Id: I65c3c43df83e0c364a4b7f1f3054c5b676bd07d5 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11605 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
13 days r/8084 fix(nix-compat/wire/bytes/reader): drop allow(dead_code)edef1-1/+0
We're using this in the NAR reader now. Change-Id: I28f17b1ccedd62ffcaf2fa32b517f16bcd036d94 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11603 Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
2024-05-04 r/8075 feat(nix-compat/nar/reader): async supportedef1-1/+1
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
2024-05-04 r/8074 feat(nix-compat/wire/bytes/reader): parametrise on trailer tagedef1-1/+1
This allows using BytesReader with a custom tag, eg the closing parens for the NAR reader. No public constructor is provided for custom-tagged readers, since this feature isn't public API. Change-Id: I82e73d064edc4b6783ead1d6fe46a5b35f45c844 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11543 Reviewed-by: Brian Olsen <me@griff.name> Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2024-04-30 r/8043 fix(tvix/nix-compat/wire): RangeInclusive<usize> for memory size boundsedef1-29/+27
u64 is an inappropriate type for something memory-sized, and most callers end up with off-by-ones when using `..` rather than `..=`, including the tests for the module itself. Change-Id: If3b7bea27eb0a6c01e0a5d7e64966acbbb664268 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11550 Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
2024-04-30 r/8042 refactor(nix-compat/wire): drop primitive functionsedef1-5/+3
These may as well be inlined, and hardly need tests, since they just alias AsyncReadExt::read_u64_le / AsyncWriteExt::write_u64_le. Boolean reading is worth making explicit, since callers may differ on how they want to handle values other than 0 and 1. Boolean writing simplifies to `.write_u64_le(x as u64)`, which is also fine to inline. Change-Id: Ief9722fe886688693feb924ff0306b5bc68dd7a2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11549 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2024-04-30 r/8041 refactor(nix-compat/wire/bytes): branchless padding computationedef1-7/+8
Change-Id: Ie07c2516a485c78afa6f9a3c8256e9708c4c42c5 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11548 Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
2024-04-30 r/8040 fix(tvix/nix-compat/wire/bytes): return UnexpectedEof for unexpected EOFedef1-4/+1
Change-Id: I8cb79f93742cc3a9088701bc8c2795de893eb6a8 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11547 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2024-04-25 r/8013 refactor(nix-compat/wire): move BytesPacketPosition into writeredef1-19/+0
We don't use it in the reader anymore. Change-Id: I98fe204a747711464e9e7ca17df06fa9854eb344 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11519 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2024-04-24 r/8003 docs(tvix/nix-compat): add missing reference to BytesReaderFlorian Klink1-2/+2
Change-Id: Ideed83d191b55e131720e598b7591e8375a26cfd Reviewed-on: https://cl.tvl.fyi/c/depot/+/11510 Tested-by: BuildkiteCI Reviewed-by: edef <edef@edef.eu> Autosubmit: flokli <flokli@flokli.de>
2024-04-13 r/7896 refactor(tvix/nix-compat): reorganize wire and bytesFlorian Klink1-0/+254
Move everything bytes-related into its own module, and re-export both bytes and primitive in a flat space from wire/mod.rs. Expose this if a `wire` feature flag is set. We only have `async` stuff in here. Change-Id: Ia4ce4791f13a5759901cc9d6ce6bd6bbcca587c7 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11389 Autosubmit: flokli <flokli@flokli.de> Reviewed-by: raitobezarius <tvl@lahfa.xyz> Tested-by: BuildkiteCI Reviewed-by: Brian Olsen <me@griff.name>