pub trait VideoModel:
Send
+ Sync
+ 'static {
// Required methods
fn provider(&self) -> &ProviderId;
fn model_id(&self) -> &ModelId;
fn max_videos_per_call(&self) -> Option<usize>;
// Provided methods
fn supports_generate(&self) -> bool { ... }
fn do_generate(
&self,
options: VideoOptions,
) -> impl Future<Output = Result<VideoResult, ProviderError>> + Send { ... }
fn supports_operations(&self) -> bool { ... }
fn do_start(
&self,
options: VideoStartOptions,
) -> impl Future<Output = Result<VideoStartResult, ProviderError>> + Send { ... }
fn do_status(
&self,
options: VideoStatusOptions,
) -> impl Future<Output = Result<VideoStatusResult, ProviderError>> + Send { ... }
fn supports_webhook(&self) -> bool { ... }
fn handle_webhook(
&self,
factory: WebhookFactory,
) -> impl Future<Output = Result<WebhookHandle, ProviderError>> + Send { ... }
}Expand description
A model that generates videos.
Required Methods§
Sourcefn provider(&self) -> &ProviderId
fn provider(&self) -> &ProviderId
Provider identifier.
Sourcefn max_videos_per_call(&self) -> Option<usize>
fn max_videos_per_call(&self) -> Option<usize>
Maximum number of videos per call, or None when unknown (treated as 1).
Provided Methods§
Sourcefn supports_generate(&self) -> bool
fn supports_generate(&self) -> bool
Whether do_generate is implemented.
Sourcefn do_generate(
&self,
options: VideoOptions,
) -> impl Future<Output = Result<VideoResult, ProviderError>> + Send
fn do_generate( &self, options: VideoOptions, ) -> impl Future<Output = Result<VideoResult, ProviderError>> + Send
Generates videos and waits for the result in one call.
Sourcefn supports_operations(&self) -> bool
fn supports_operations(&self) -> bool
Sourcefn do_start(
&self,
options: VideoStartOptions,
) -> impl Future<Output = Result<VideoStartResult, ProviderError>> + Send
fn do_start( &self, options: VideoStartOptions, ) -> impl Future<Output = Result<VideoStartResult, ProviderError>> + Send
Starts an asynchronous generation operation.
Sourcefn do_status(
&self,
options: VideoStatusOptions,
) -> impl Future<Output = Result<VideoStatusResult, ProviderError>> + Send
fn do_status( &self, options: VideoStatusOptions, ) -> impl Future<Output = Result<VideoStatusResult, ProviderError>> + Send
Queries the status of an operation returned by do_start.
Sourcefn supports_webhook(&self) -> bool
fn supports_webhook(&self) -> bool
Whether the provider can deliver completion through a webhook.
Sourcefn handle_webhook(
&self,
factory: WebhookFactory,
) -> impl Future<Output = Result<WebhookHandle, ProviderError>> + Send
fn handle_webhook( &self, factory: WebhookFactory, ) -> impl Future<Output = Result<WebhookHandle, ProviderError>> + Send
Prepares a webhook for an operation.
The default implementation invokes factory unchanged. Providers that
need to register the URL or wrap the payload override this method.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".