Function winnow::bits::streaming::bool

source ·
pub fn bool<I, E: ParseError<(I, usize)>>(
    input: (I, usize)
) -> IResult<(I, usize), bool, E>where
    I: Stream<Token = u8> + AsBytes,
👎Deprecated since 0.1.0: Replaced with <code>winnow::bits::bool</code>
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)));

WARNING: Deprecated, replaced with winnow::bits::bool