pub trait ImageReader {
type Error;
// Required method
fn apply<P>(
&self,
imgs: impl IntoIterator<Item = P>,
) -> Result<Vec<ImageBuffer<Rgb<u8>, Vec<u8>>>, Self::Error>
where P: AsRef<Path> + Send + Sync;
// Provided method
fn read_single<P>(
&self,
img_path: P,
) -> Result<ImageBuffer<Rgb<u8>, Vec<u8>>, Self::Error>
where P: AsRef<Path> + Send + Sync,
Self::Error: From<OCRError> { ... }
}Expand description
Trait for reading images.
This trait defines the interface for reading images from paths.
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn read_single<P>(
&self,
img_path: P,
) -> Result<ImageBuffer<Rgb<u8>, Vec<u8>>, Self::Error>
fn read_single<P>( &self, img_path: P, ) -> Result<ImageBuffer<Rgb<u8>, Vec<u8>>, Self::Error>
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.