pub trait PeekExt<I, O, E, R> {
// Provided method
fn peek(self) -> Peek<Self, R>
where Self: Sized,
I: Clone { ... }
}Expand description
Applies a Pipe without consuming the input
Provided Methods§
Sourcefn peek(self) -> Peek<Self, R>
fn peek(self) -> Peek<Self, R>
Makes a Pipe optional if it returns a non fatal error
example:
assert_eq!(
tag::<Error, _, _>("foo").peek().apply("foobar"),
Ok(("foobar", ("foo",)))
);
assert_eq!(
tag::<Error, _, _>("boo").peek().apply("foobar"),
Err(FatalError::Error(Error::Tag(TagStrError("boo".into(), "foo".into()))))
);