-
Heya! I have a function that returns a
But So for example an invocation looks like this: winnow::binary::bits::bits::<_, _, InputError<(_, usize)>, _, _>((
winnow::binary::bits::pattern(0x0, 1usize),
winnow::binary::bits::bool,
winnow::binary::bits::bool,
winnow::binary::bits::take(2usize)
.try_map(<QualityOfService as TryFrom<u8>>::try_from),
winnow::binary::bits::bool,
winnow::binary::bits::bool,
winnow::binary::bits::bool,
))
.parse_next(input)
.map_err(|_: ErrMode<InputError<_>>| {
ErrMode::from_error_kind(input, winnow::error::ErrorKind::Slice)
})? Now, am I doing something wrong? Or is this just a current limitation? Thanks for any pointers! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
This is just overlooked as bit parsing doesn't get much attention (I wasn't even sure how much desire there is for this API!). Feel free to create an issue.
Note that |
Beta Was this translation helpful? Give feedback.
-
I like it a lot! Its super handy when one needs it, and is definitely a step up from manually using masks.
Alright, I'll try to see if I can think of something to make it easier.
Oh yeah, totally! Was mostly in the context of it being unweildy in the 'default' arrangement. I'm happy that it can be fixed! |
Beta Was this translation helpful? Give feedback.
-
Just ran into this myself, I think docs on how to use bits with |
Beta Was this translation helpful? Give feedback.
This is just overlooked as bit parsing doesn't get much attention (I wasn't even sure how much desire there is for this API!).
Feel free to create an issue.
Note that
PResult
only defaults the error type. You can explicitly specify it.