pub trait ImagePicker: Send + Sync {
// Required method
fn pick_image(
&self,
source: ImageSource,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, ImagePickerError>>>>;
}Expand description
Re-export framework services (HTTP, URI, etc.) from the dedicated services crate. Picks or captures a single image and returns its encoded bytes.
Required Methods§
Sourcefn pick_image(
&self,
source: ImageSource,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, ImagePickerError>>>>
fn pick_image( &self, source: ImageSource, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, ImagePickerError>>>>
Present a picker/camera for source and resolve to the chosen image’s
encoded bytes, or None if the user cancelled.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".