pub trait Pass {
type Input<'a>;
type Output<'a>;
type Error;
// Required method
fn run<'a>(
&mut self,
input: Self::Input<'a>,
) -> Result<Self::Output<'a>, Self::Error>;
// Provided method
fn chain<P, E>(self, pass: P) -> Chain<Self, P>
where Self: Sized,
E: From<Self::Error>,
P: for<'a> Pass<Input<'a> = Self::Output<'a>, Error = E> { ... }
}
Expand description
This trait represents anything that can be run as a pass.
Passes operate on an input value, and return either the same type, or a new type, depending on the nature of the pass.
Implementations may represent a single pass, or an arbitrary number of passes that will be run as a single unit.
Functions are valid implementations of Pass
as long as their signature is fn<I, O, E>(I) -> Result<O, E>
.
Required Associated Types§
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.