Function combine::value

source ·
pub fn value<I, T>(v: T) -> Value<I, T>where
    I: Stream,
    T: Clone,
Expand description

Always returns the value v without consuming any input.

let result = value(42)
    .parse("hello world")
    .map(|x| x.0);
assert_eq!(result, Ok(42));