-
Hi there! What's the best way to parse something like I could just parse that byte and then refer back to it, but that would require defining it in the struct: struct Packet {
the_byte: u8,
field1: u8,
field2: u8,
} and then in the parse function something like (untested): seq! {Self{
the_byte: be_u8,
field1: (the_byte & 0xc0) >> 6,
field2: the_byte & 0x3f,
}}.parse_next(i) Maybe that's the best way, just wanted to throw this out. Thanks! Christoph |
Beta Was this translation helpful? Give feedback.
Answered by
epage
Jun 12, 2024
Replies: 1 comment 2 replies
-
That or not use |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
ckoehler
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That or not use
seq!
and maybe even parse more imperatively.