Unless I am missing something, deku::input is not usable as read(..) never has __deku_input and DekuRead will always generate read(..)
use deku::bitvec::{BitSlice, Msb0};
use deku::prelude::*;
#[derive(DekuRead, Debug, PartialEq, Eq)]
struct Block {
#[deku(assert_eq = "deku::input.1 as u8")]
a: u8,
#[deku(count = "deku::input.1 as u8")]
b: Vec<u8>,
}
#[derive(DekuRead, Debug, PartialEq, Eq)]
#[deku(ctx = "a: u8")]
struct BlockB {
#[deku(assert_eq = "deku::input.1 as u8")]
a: u8,
#[deku(count = "deku::input.1 as u8")]
b: Vec<u8>,
}
fn main() {
}
error[E0425]: cannot find value `__deku_input` in this scope
--> src/main.rs:6:24
|
6 | #[deku(assert_eq = "deku::input.1 as u8")]
| ^^^^^^^^^^^^^^^^^^^^^ help: a local variable with a similar name exists: `__deku_rest`
error[E0425]: cannot find value `__deku_input` in this scope
--> src/main.rs:8:20
|
8 | #[deku(count = "deku::input.1 as u8")]
| ^^^^^^^^^^^^^^^^^^^^^ help: a local variable with a similar name exists: `__deku_rest`
error[E0425]: cannot find value `__deku_input` in this scope
--> src/main.rs:15:24
|
15 | #[deku(assert_eq = "deku::input.1 as u8")]
| ^^^^^^^^^^^^^^^^^^^^^ help: a local variable with a similar name exists: `__deku_rest`
error[E0425]: cannot find value `__deku_input` in this scope
--> src/main.rs:17:20
|
17 | #[deku(count = "deku::input.1 as u8")]
| ^^^^^^^^^^^^^^^^^^^^^ help: a local variable with a similar name exists: `__deku_rest`
Unless I am missing something,
deku::input
is not usable asread(..)
never has__deku_input
andDekuRead
will always generateread(..)