pub trait ImageModel:
Send
+ Sync
+ 'static {
// Required methods
fn provider(&self) -> &ProviderId;
fn model_id(&self) -> &ModelId;
fn max_images_per_call(&self) -> Option<usize>;
fn do_generate(
&self,
options: ImageOptions,
) -> impl Future<Output = Result<ImageResult, ProviderError>> + Send;
}Expand description
A model that generates images from a prompt.
Required Methods§
Sourcefn provider(&self) -> &ProviderId
fn provider(&self) -> &ProviderId
Provider identifier.
Sourcefn max_images_per_call(&self) -> Option<usize>
fn max_images_per_call(&self) -> Option<usize>
Maximum number of images per call, or None when unknown (treated as 1).
Sourcefn do_generate(
&self,
options: ImageOptions,
) -> impl Future<Output = Result<ImageResult, ProviderError>> + Send
fn do_generate( &self, options: ImageOptions, ) -> impl Future<Output = Result<ImageResult, ProviderError>> + Send
Generates options.n images.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".