pub trait ImageProvider: Send + Sync {
type Config: ProviderConfig;
type Response: ImageResponse;
type Error: ProviderError;
// Required method
fn generate_image<'life0, 'async_trait>(
&'life0 self,
request: ImageRequest,
) -> Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait;
}
Expand description
Optional trait for providers that support image generation.
Required Associated Types§
Sourcetype Config: ProviderConfig
type Config: ProviderConfig
Provider-specific configuration type
Sourcetype Response: ImageResponse
type Response: ImageResponse
Provider-specific response type
Sourcetype Error: ProviderError
type Error: ProviderError
Provider-specific error type