pub trait Detect<IO> {
type DetOut;
type IOOut;
// Required method
fn detect(
&self,
io: IO,
) -> impl Future<Output = Result<(Self::DetOut, Self::IOOut)>>;
}Expand description
Detect is a trait for detecting a certain pattern in the input stream.
It accepts an input stream and returns a tuple of the detected pattern and the wrapped input
stream which is usually a PrefixedReadIo. The implementation can choose to whether add the
prefix data.
If it fails to detect the pattern, it should represent the error inside the DetOut.
Required Associated Types§
Required 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.