pub trait AndExt<I, O, E, R> {
// Provided methods
fn and<O2, R2, P>(self, p: P) -> And<Self, P, O, O2, R>
where Self: Sized,
O: Extend<O2>,
O2: HList,
P: Pipe<R, O2, E, R2> { ... }
fn and_other<O2, R2, P>(self, p: P) -> AndOther<Self, P, O, R>
where Self: Sized,
P: Pipe<R, O2, E, R2> { ... }
fn and_self<O2, R2, P>(self, other: P) -> AndSelf<Self, P, R, O2>
where Self: Sized,
P: Pipe<R, O2, E, R2> { ... }
}Expand description
Combinator that chains 2 pipes together
Provided Methods§
Sourcefn and<O2, R2, P>(self, p: P) -> And<Self, P, O, O2, R>
fn and<O2, R2, P>(self, p: P) -> And<Self, P, O, O2, R>
Chains 2 Pipes one after another
The 2 output are combined into a single HList
Example:
assert_eq!(
tag::<Error, _, _>("foo").and(tag("bar")).apply("foobar"),
Ok(("", ("foo", "bar")))
);
assert_eq!(
tag::<Error, _, _>("foo").and(tag("boo")).apply("foobar"),
Err(FatalError::Error(Error::Tag(TagStrError("boo".into(), "bar".into()))))
);
assert_eq!(
tag::<Error, _, _>("foo").and(tag("boo")).apply("foobo"),
Err(FatalError::Error(Error::Incomplete(Incomplete::Size(1))))
);