From 9af69204787d47cfe551f524d01b1a726971f06e Mon Sep 17 00:00:00 2001 From: Brian Olsen Date: Sat, 20 Jul 2024 11:25:04 +0200 Subject: feat(nix-compat): Add NixDeserialize and NixRead traits Add a trait for deserializing a type from a daemon worker connection. This adds the NixDeserialize trait which is kind of like the serde Deserialize trait in that individual types are meant to implement it and it can potentially be derived in the future. The NixDeserialize trait takes something that implements NixRead as input so that you can among other things mock the reader. Change-Id: Ibb59e3562dfc822652f7d18039f00a1c0d422997 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11990 Autosubmit: Brian Olsen Reviewed-by: flokli Tested-by: BuildkiteCI --- tvix/tools/weave/Cargo.lock | 5 +++-- tvix/tools/weave/Cargo.nix | 14 ++++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) (limited to 'tvix/tools/weave') diff --git a/tvix/tools/weave/Cargo.lock b/tvix/tools/weave/Cargo.lock index ccd050c30ff1..bb571af1a20d 100644 --- a/tvix/tools/weave/Cargo.lock +++ b/tvix/tools/weave/Cargo.lock @@ -271,9 +271,9 @@ dependencies = [ [[package]] name = "bytes" -version = "1.5.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" [[package]] name = "cc" @@ -927,6 +927,7 @@ version = "0.1.0" dependencies = [ "bitflags 2.4.2", "bstr", + "bytes", "data-encoding", "ed25519", "ed25519-dalek", diff --git a/tvix/tools/weave/Cargo.nix b/tvix/tools/weave/Cargo.nix index 29d8eab30da9..25b2c94a3f11 100644 --- a/tvix/tools/weave/Cargo.nix +++ b/tvix/tools/weave/Cargo.nix @@ -792,9 +792,9 @@ rec { }; "bytes" = rec { crateName = "bytes"; - version = "1.5.0"; + version = "1.6.1"; edition = "2018"; - sha256 = "08w2i8ac912l8vlvkv3q51cd4gr09pwlg3sjsjffcizlrb0i5gd2"; + sha256 = "0lnryqfiymbq5mfflfmbsqvfnw80kkh36nk5kpiscgxb9ac1cad1"; authors = [ "Carl Lerche " "Sean McArthur " @@ -2698,6 +2698,11 @@ rec { packageId = "bstr"; features = [ "alloc" "unicode" "serde" ]; } + { + name = "bytes"; + packageId = "bytes"; + optional = true; + } { name = "data-encoding"; packageId = "data-encoding"; @@ -2775,12 +2780,13 @@ rec { ]; features = { "async" = [ "tokio" ]; + "bytes" = [ "dep:bytes" ]; "default" = [ "async" "wire" ]; "pin-project-lite" = [ "dep:pin-project-lite" ]; "tokio" = [ "dep:tokio" ]; - "wire" = [ "tokio" "pin-project-lite" ]; + "wire" = [ "tokio" "pin-project-lite" "bytes" ]; }; - resolvedDefaultFeatures = [ "async" "default" "pin-project-lite" "tokio" "wire" ]; + resolvedDefaultFeatures = [ "async" "bytes" "default" "pin-project-lite" "tokio" "wire" ]; }; "nom" = rec { crateName = "nom"; -- cgit 1.4.1