-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How about offset into some data? #337
Comments
I think you would use something like header()
.then(|header| {
parse(|input| {
// Do a separate parse at the offset(s)
let (output, _input) = my_parser().parse_state(&input[header.offset..])?;
// Then return the original input to continue parsing there (or return the input where you want to continue parsing)
Ok((output, input))
})
}) |
That's exact functionality that I need. Thanks! |
Sure, that seems generally useful. |
Hello. First of all, my thanks for this crate.
So, I'm working on binary data parser, but I have some problems about offsets. Structure looks like this:
How can I solve the problem of offset access using
combine
crate? Header and data by offsets should be stored in custom struct. Thanks in advance!The text was updated successfully, but these errors were encountered: