pub fn bool<I, E>(input: (I, usize)) -> Result<((I, usize), bool), Err<E>>
Available on crate feature
mtls
only.Expand description
Parses one specific bit as a bool.
§Example
fn parse(input: (&[u8], usize)) -> IResult<(&[u8], usize), bool> {
bool(input)
}
assert_eq!(parse(([0b10000000].as_ref(), 0)), Ok((([0b10000000].as_ref(), 1), true)));
assert_eq!(parse(([0b10000000].as_ref(), 1)), Ok((([0b10000000].as_ref(), 2), false)));