pub trait VideoModel:
Send
+ Sync
+ Debug {
// Required methods
fn provider(&self) -> &str;
fn model_id(&self) -> &str;
fn do_generate<'life0, 'async_trait>(
&'life0 self,
options: VideoOptions,
) -> Pin<Box<dyn Future<Output = Result<VideoResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn specification_version(&self) -> &'static str { ... }
fn max_videos_per_call<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<u32>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
Contract every video-generation model implements.
Required Methods§
Sourcefn do_generate<'life0, 'async_trait>(
&'life0 self,
options: VideoOptions,
) -> Pin<Box<dyn Future<Output = Result<VideoResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn do_generate<'life0, 'async_trait>(
&'life0 self,
options: VideoOptions,
) -> Pin<Box<dyn Future<Output = Result<VideoResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Generate videos.
§Errors
Returns a crate::ProviderError when the upstream call fails, the
generation job times out, or the response is malformed.
Provided Methods§
Sourcefn specification_version(&self) -> &'static str
fn specification_version(&self) -> &'static str
Specification version (currently "v4").
Sourcefn max_videos_per_call<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<u32>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn max_videos_per_call<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<u32>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Maximum videos that can be requested per call.
Most video models only support n=1 due to computational cost; the
default returns Some(1).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".