From 3893c9db0bd3d2e2521e1539a01398a09d9c996c Mon Sep 17 00:00:00 2001 From: Sven Friedrich Date: Tue, 30 Jan 2024 13:11:43 +0100 Subject: [PATCH 1/4] chore: flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'devshell': 'github:numtide/devshell/c2feacb46ee69949124c835419861143c4016fb5' (2022-08-18) → 'github:numtide/devshell/83cb93d6d063ad290beee669f4badf9914cc16ec' (2024-01-15) • Updated input 'devshell/flake-utils': 'github:numtide/flake-utils/846b2ae0fc4cc943637d3d1def4454213e203cba' (2022-01-20) → 'github:numtide/flake-utils/4022d587cbbfd70fe950c1e2083a02621806a725' (2023-12-04) • Added input 'devshell/flake-utils/systems': 'github:nix-systems/default/da67096a3b9bf56a91d16901293e51ba5b49a27e' (2023-04-09) • Updated input 'devshell/nixpkgs': 'github:NixOS/nixpkgs/5efc8ca954272c4376ac929f4c5ffefcc20551d5' (2022-01-28) → 'github:NixOS/nixpkgs/63143ac2c9186be6d9da6035fa22620018c85932' (2024-01-02) • Updated input 'fenix': 'github:nix-community/fenix/ad632ed546a3c33b64505ca0dba262f46082d73e' (2022-09-12) → 'github:nix-community/fenix/46a368edf5f1cc16573157797e5acead834d5b2c' (2024-01-30) • Updated input 'fenix/rust-analyzer-src': 'github:rust-lang/rust-analyzer/2e9f1204ca01c3e20898d4a67c8b84899d394a88' (2022-09-11) → 'github:rust-lang/rust-analyzer/d13951f25c4cb880bff09a3c02a796ecc51f69ac' (2024-01-29) • Updated input 'nixpkgs': 'path:/nix/store/aw7bxjysi3wd3xia5qh7qqwsbqmyqbya-source?lastModified=0&narHash=sha256-50235YW76Jnx4okogoJv/sMz%2BWNnqC%2B0DqtkV3jm2XM%3D' (1970-01-01) → 'github:NixOS/nixpkgs/6723fa4e4f1a30d42a633bef5eb01caeb281adc3' (2024-01-08) • Updated input 'utils': 'github:numtide/flake-utils/c0e246b9b83f637f4681389ecabcb2681b4f3af0' (2022-08-07) → 'github:numtide/flake-utils/1ef2e671c3b0c19053962c07dbda38332dcebf26' (2024-01-15) • Added input 'utils/systems': 'github:nix-systems/default/da67096a3b9bf56a91d16901293e51ba5b49a27e' (2023-04-09) --- flake.lock | 82 +++++++++++++++++++++++++++++++++++++++--------------- flake.nix | 2 +- 2 files changed, 61 insertions(+), 23 deletions(-) diff --git a/flake.lock b/flake.lock index 5f66aa8..c269704 100644 --- a/flake.lock +++ b/flake.lock @@ -6,11 +6,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1660811669, - "narHash": "sha256-V6lmsaLNFz41myppL0yxglta92ijkSvpZ+XVygAh+bU=", + "lastModified": 1705332421, + "narHash": "sha256-USpGLPme1IuqG78JNqSaRabilwkCyHmVWY0M9vYyqEA=", "owner": "numtide", "repo": "devshell", - "rev": "c2feacb46ee69949124c835419861143c4016fb5", + "rev": "83cb93d6d063ad290beee669f4badf9914cc16ec", "type": "github" }, "original": { @@ -27,11 +27,11 @@ "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1662965863, - "narHash": "sha256-HLJNVthKQLtilC1xpuonhECJO4UZ0+JtIDwozqhwko4=", + "lastModified": 1706595721, + "narHash": "sha256-nf5/lPawM20WO1gHAlsUwDEJ4v+InC3BYYV1EBsBJZk=", "owner": "nix-community", "repo": "fenix", - "rev": "ad632ed546a3c33b64505ca0dba262f46082d73e", + "rev": "46a368edf5f1cc16573157797e5acead834d5b2c", "type": "github" }, "original": { @@ -41,12 +41,15 @@ } }, "flake-utils": { + "inputs": { + "systems": "systems" + }, "locked": { - "lastModified": 1642700792, - "narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=", + "lastModified": 1701680307, + "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", "owner": "numtide", "repo": "flake-utils", - "rev": "846b2ae0fc4cc943637d3d1def4454213e203cba", + "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", "type": "github" }, "original": { @@ -57,11 +60,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1643381941, - "narHash": "sha256-pHTwvnN4tTsEKkWlXQ8JMY423epos8wUOhthpwJjtpc=", + "lastModified": 1704161960, + "narHash": "sha256-QGua89Pmq+FBAro8NriTuoO/wNaUtugt29/qqA8zeeM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5efc8ca954272c4376ac929f4c5ffefcc20551d5", + "rev": "63143ac2c9186be6d9da6035fa22620018c85932", "type": "github" }, "original": { @@ -73,10 +76,12 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 0, - "narHash": "sha256-50235YW76Jnx4okogoJv/sMz+WNnqC+0DqtkV3jm2XM=", - "path": "/nix/store/aw7bxjysi3wd3xia5qh7qqwsbqmyqbya-source", - "type": "path" + "lastModified": 1704732714, + "narHash": "sha256-ABqK/HggMYA/jMUXgYyqVAcQ8QjeMyr1jcXfTpSHmps=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "6723fa4e4f1a30d42a633bef5eb01caeb281adc3", + "type": "github" }, "original": { "id": "nixpkgs", @@ -94,11 +99,11 @@ "rust-analyzer-src": { "flake": false, "locked": { - "lastModified": 1662896065, - "narHash": "sha256-1LkSsXzI1JTAmP/GMTz4fTJd8y/tw8R79l96q+h7mu8=", + "lastModified": 1706540258, + "narHash": "sha256-6RTztJE21l0hfWHp0qMWBurWnoFmUxYEDCvaGTnQYcA=", "owner": "rust-lang", "repo": "rust-analyzer", - "rev": "2e9f1204ca01c3e20898d4a67c8b84899d394a88", + "rev": "d13951f25c4cb880bff09a3c02a796ecc51f69ac", "type": "github" }, "original": { @@ -108,13 +113,46 @@ "type": "github" } }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "utils": { + "inputs": { + "systems": "systems_2" + }, "locked": { - "lastModified": 1659877975, - "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", "owner": "numtide", "repo": "flake-utils", - "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 07e3491..fc99446 100644 --- a/flake.nix +++ b/flake.nix @@ -12,7 +12,7 @@ let pkgs = import nixpkgs { inherit system; - overlays = [ devshell.overlay ]; + overlays = [ devshell.overlays.default ]; }; rust-toolchain = with fenix.packages.${system}; combine [ From 857d827cd581fd1f5d2a4094e974b1ea2c06a580 Mon Sep 17 00:00:00 2001 From: Sven Friedrich Date: Tue, 30 Jan 2024 14:18:01 +0100 Subject: [PATCH 2/4] chore: update a653rs --- Cargo.toml | 2 +- src/queuing.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b54704f..d3d6bb3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,4 +12,4 @@ serde = { version = "1.0", features = ["derive"], default-features = false } postcard = { version = "1.0", default-features = false } arrayvec = { version = "0.7", default-features = false } -a653rs = "0.4" +a653rs = "0.5" diff --git a/src/queuing.rs b/src/queuing.rs index b9b9bbe..2d9bffa 100644 --- a/src/queuing.rs +++ b/src/queuing.rs @@ -45,7 +45,7 @@ where T: for<'a> Deserialize<'a>, { let mut msg_buf = [0u8; MSG_SIZE as usize]; - let msg = self.receive(&mut msg_buf, timeout)?; + let (msg, _overflow) = self.receive(&mut msg_buf, timeout)?; let msg_slice = DeSlice::new(msg); let mut deserializer = postcard::Deserializer::from_flavor(msg_slice); match T::deserialize(&mut deserializer) { From b28f56aa7a41185f456de7f5fb1c8e05f94147b6 Mon Sep 17 00:00:00 2001 From: Sven Friedrich Date: Tue, 30 Jan 2024 14:20:01 +0100 Subject: [PATCH 3/4] feat!: return overflow status in queuing port `recv_type` function the `recv_type` function for queuing ports changed --- src/queuing.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/queuing.rs b/src/queuing.rs index 2d9bffa..d0274e1 100644 --- a/src/queuing.rs +++ b/src/queuing.rs @@ -13,7 +13,10 @@ pub trait QueuingPortSenderExt { } pub trait QueuingPortReceiverExt { - fn recv_type(&self, timeout: SystemTime) -> Result> + fn recv_type( + &self, + timeout: SystemTime, + ) -> Result<(T, QueueOverflow), QueuingRecvError> where T: for<'a> Deserialize<'a>, [u8; MSG_SIZE as usize]:; @@ -40,16 +43,19 @@ impl(&self, timeout: SystemTime) -> Result> + fn recv_type( + &self, + timeout: SystemTime, + ) -> Result<(T, QueueOverflow), QueuingRecvError> where T: for<'a> Deserialize<'a>, { let mut msg_buf = [0u8; MSG_SIZE as usize]; - let (msg, _overflow) = self.receive(&mut msg_buf, timeout)?; + let (msg, overflow) = self.receive(&mut msg_buf, timeout)?; let msg_slice = DeSlice::new(msg); let mut deserializer = postcard::Deserializer::from_flavor(msg_slice); match T::deserialize(&mut deserializer) { - Ok(t) => Ok(t), + Ok(t) => Ok((t, overflow)), Err(e) => { let mut msg = ArrayVec::from(msg_buf); msg.truncate(msg.len()); From 0b353d9b253044f8aad52533529ce47dd9799adf Mon Sep 17 00:00:00 2001 From: Sven Friedrich Date: Tue, 30 Jan 2024 14:21:12 +0100 Subject: [PATCH 4/4] chore: release 0.3.0 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index d3d6bb3..0fb10b1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "a653rs-postcard" -version = "0.2.0" +version = "0.3.0" edition = "2021" authors = ["Sven Friedrich "] license = "MIT OR Apache-2.0"