You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Firstly, thank you for this excellent work.
Seriously look forward to how much better this is going to get.
Request your inputs/help please on the following use case:
pub struct H {
a: u16,
#[deku(map = "H::morph")]
b: String,
}
impl H {
pub fn morph(bytes: [u8; 4]) -> Result<String, DekuError> {
// here I use both bytes & len
}
}
What I want to do is use something like #[deku(map = "H::morph(4)")] to specify how many bytes to take in into the function.
That is, is there a way to pass the 4 to the fn morph from the #[deku(map ...)] definition?
Thank you!
The text was updated successfully, but these errors were encountered:
I noticed that there's a bytes_read attribute.
Can this be updated to make it accept a number directly, rather than having to specify it through another field in the same struct?
That would be awesome; will help my current situation.
Hello,
Firstly, thank you for this excellent work.
Seriously look forward to how much better this is going to get.
Request your inputs/help please on the following use case:
What I want to do is use something like
#[deku(map = "H::morph(4)")]
to specify how many bytes to take in into the function.That is, is there a way to pass the
4
to thefn morph
from the#[deku(map ...)]
definition?Thank you!
The text was updated successfully, but these errors were encountered: