Skip to main content

ImageModel

Trait ImageModel 

Source
pub trait ImageModel: Send + Sync {
    // Required methods
    fn provider_name(&self) -> &str;
    fn model_id(&self) -> &str;
    fn max_images_per_call(&self) -> impl Future<Output = Option<u32>> + Send;
    fn generate(
        &self,
        options: ImageModelCallOptions,
    ) -> impl Future<Output = ImageModelGenerationResult> + Send;
}

Required Methods§

Source

fn provider_name(&self) -> &str

Source

fn model_id(&self) -> &str

Source

fn max_images_per_call(&self) -> impl Future<Output = Option<u32>> + Send

Source

fn generate( &self, options: ImageModelCallOptions, ) -> impl Future<Output = ImageModelGenerationResult> + Send

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.

Implementations on Foreign Types§

Source§

impl<DYNOSAUR> ImageModel for &DYNOSAUR
where DYNOSAUR: ?Sized + ImageModel, Self: Send + Sync,

Source§

fn provider_name(&self) -> &str

Source§

fn model_id(&self) -> &str

Source§

fn max_images_per_call(&self) -> impl Future<Output = Option<u32>> + Send

Source§

fn generate( &self, options: ImageModelCallOptions, ) -> impl Future<Output = ImageModelGenerationResult> + Send

Source§

impl<DYNOSAUR> ImageModel for &mut DYNOSAUR
where DYNOSAUR: ?Sized + ImageModel, Self: Send + Sync,

Source§

fn provider_name(&self) -> &str

Source§

fn model_id(&self) -> &str

Source§

fn max_images_per_call(&self) -> impl Future<Output = Option<u32>> + Send

Source§

fn generate( &self, options: ImageModelCallOptions, ) -> impl Future<Output = ImageModelGenerationResult> + Send

Source§

impl<DYNOSAUR> ImageModel for Box<DYNOSAUR>
where DYNOSAUR: ?Sized + ImageModel, Self: Send + Sync,

Source§

fn provider_name(&self) -> &str

Source§

fn model_id(&self) -> &str

Source§

fn max_images_per_call(&self) -> impl Future<Output = Option<u32>> + Send

Source§

fn generate( &self, options: ImageModelCallOptions, ) -> impl Future<Output = ImageModelGenerationResult> + Send

Implementors§

Source§

impl<'dynosaur_struct> ImageModel for DynImageModel<'dynosaur_struct>