add bytechecking for txconfig, drop repr(c)

This commit is contained in:
Joe Ardent 2023-08-18 16:12:54 -07:00
parent 7f1abe1261
commit 881d225202
3 changed files with 28 additions and 4 deletions

29
Cargo.lock generated
View file

@ -571,7 +571,18 @@ version = "0.6.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b6372023ac861f6e6dc89c8344a8f398fb42aaba2b5dbc649ca0c0e9dbcb627" checksum = "8b6372023ac861f6e6dc89c8344a8f398fb42aaba2b5dbc649ca0c0e9dbcb627"
dependencies = [ dependencies = [
"bytecheck_derive", "bytecheck_derive 0.6.11",
"ptr_meta",
"simdutf8",
]
[[package]]
name = "bytecheck"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41502630fe304ce54cbb2f8389e017784dee2b0328147779fcbe43b9db06d35d"
dependencies = [
"bytecheck_derive 0.7.0",
"ptr_meta", "ptr_meta",
"simdutf8", "simdutf8",
] ]
@ -587,6 +598,17 @@ dependencies = [
"syn 1.0.109", "syn 1.0.109",
] ]
[[package]]
name = "bytecheck_derive"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eda88c587085bc07dc201ab9df871bd9baa5e07f7754b745e4d7194b43ac1eda"
dependencies = [
"proc-macro2",
"quote",
"syn 1.0.109",
]
[[package]] [[package]]
name = "bytemuck" name = "bytemuck"
version = "1.13.1" version = "1.13.1"
@ -905,6 +927,7 @@ dependencies = [
name = "cuttle" name = "cuttle"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"bytecheck 0.7.0",
"clap", "clap",
"eframe", "eframe",
"egui_extras", "egui_extras",
@ -2513,7 +2536,7 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "581008d2099240d37fb08d77ad713bcaec2c4d89d50b5b21a8bb1996bbab68ab" checksum = "581008d2099240d37fb08d77ad713bcaec2c4d89d50b5b21a8bb1996bbab68ab"
dependencies = [ dependencies = [
"bytecheck", "bytecheck 0.6.11",
] ]
[[package]] [[package]]
@ -2557,7 +2580,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0200c8230b013893c0b2d6213d6ec64ed2b9be2e0e016682b7224ff82cff5c58" checksum = "0200c8230b013893c0b2d6213d6ec64ed2b9be2e0e016682b7224ff82cff5c58"
dependencies = [ dependencies = [
"bitvec", "bitvec",
"bytecheck", "bytecheck 0.6.11",
"hashbrown 0.12.3", "hashbrown 0.12.3",
"ptr_meta", "ptr_meta",
"rend", "rend",

View file

@ -8,6 +8,7 @@ default = ["desktop"]
desktop = ["dep:clap", "dep:eframe", "dep:egui_extras", "dep:fast_qr", "dep:png"] desktop = ["dep:clap", "dep:eframe", "dep:egui_extras", "dep:fast_qr", "dep:png"]
[dependencies] [dependencies]
bytecheck = "0.7"
clap = { version = "4.3", optional = true, features = ["derive", "env"] } clap = { version = "4.3", optional = true, features = ["derive", "env"] }
eframe = { version = "0.22", default-features = false, optional = true, features = ["default_fonts", "wgpu", "tts", "accesskit"] } eframe = { version = "0.22", default-features = false, optional = true, features = ["default_fonts", "wgpu", "tts", "accesskit"] }
egui_extras = { version = "0.22", default-features = false, optional = true, features = ["chrono", "image"] } egui_extras = { version = "0.22", default-features = false, optional = true, features = ["chrono", "image"] }

View file

@ -70,7 +70,7 @@ pub enum StreamStatus {
} }
#[derive(Debug, Clone, PartialEq, Eq, Archive, Serialize, Deserialize)] #[derive(Debug, Clone, PartialEq, Eq, Archive, Serialize, Deserialize)]
#[repr(C)] #[archive(check_bytes)]
pub struct TxConfig { pub struct TxConfig {
pub len: u64, pub len: u64,
pub mtu: u16, pub mtu: u16,