about summary refs log tree commit diff
path: root/tvix/nix-compat/src/wire/mod.rs
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2024-04-04T16·03+0300
committerclbot <clbot@tvl.fyi>2024-04-06T14·12+0000
commitf3d8c633f2b4c44a6911d751a2efd93ef926a8bf (patch)
treea00891ab1c9699baeb9848065634bcd00dcb7f5d /tvix/nix-compat/src/wire/mod.rs
parent39276dc5b41fa5e756ebb8ae30b4d2ac91995be7 (diff)
feat(tvix/nix-compat/wire): introduce BytesWriter r/7857
This deals with writing byte packets of larger sizes to an underlying
AsyncWrite.

Its constructor receives the expected size. It also deals with writing
padding if flush/shutdown is called after writing all the payload.

Change-Id: I8acbf992467f3862ffb8c7d669e8c0c8eced14c1
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11355
Reviewed-by: picnoir picnoir <picnoir@alternativebit.fr>
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: Brian Olsen <me@griff.name>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/nix-compat/src/wire/mod.rs')
-rw-r--r--tvix/nix-compat/src/wire/mod.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/tvix/nix-compat/src/wire/mod.rs b/tvix/nix-compat/src/wire/mod.rs
index cd7b87aacd85..cb14e4d420b7 100644
--- a/tvix/nix-compat/src/wire/mod.rs
+++ b/tvix/nix-compat/src/wire/mod.rs
@@ -5,6 +5,11 @@
 pub mod bytes;
 
 #[cfg(feature = "async")]
+mod bytes_writer;
+#[cfg(feature = "async")]
+pub use bytes_writer::BytesWriter;
+
+#[cfg(feature = "async")]
 pub mod primitive;
 
 #[cfg(feature = "async")]