pub trait VideoModelMiddleware:
Send
+ Sync
+ Debug {
// Provided methods
fn override_provider(&self, _inner: &dyn VideoModel) -> Option<String> { ... }
fn override_model_id(&self, _inner: &dyn VideoModel) -> Option<String> { ... }
fn override_max_videos_per_call<'life0, 'life1, 'async_trait>(
&'life0 self,
_inner: &'life1 dyn VideoModel,
) -> Pin<Box<dyn Future<Output = Option<Option<u32>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn transform_params<'life0, 'life1, 'async_trait>(
&'life0 self,
params: VideoOptions,
_inner: &'life1 dyn VideoModel,
) -> Pin<Box<dyn Future<Output = Result<VideoOptions>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn wrap_generate<'life0, 'life1, 'async_trait>(
&'life0 self,
next: &'life1 dyn VideoModel,
params: VideoOptions,
) -> Pin<Box<dyn Future<Output = Result<VideoResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}Expand description
Contract for middleware that decorates a VideoModel.
Provided Methods§
Sourcefn override_provider(&self, _inner: &dyn VideoModel) -> Option<String>
fn override_provider(&self, _inner: &dyn VideoModel) -> Option<String>
Override the provider id exposed by the wrapped model.
Sourcefn override_model_id(&self, _inner: &dyn VideoModel) -> Option<String>
fn override_model_id(&self, _inner: &dyn VideoModel) -> Option<String>
Override the model id exposed by the wrapped model.
Sourcefn override_max_videos_per_call<'life0, 'life1, 'async_trait>(
&'life0 self,
_inner: &'life1 dyn VideoModel,
) -> Pin<Box<dyn Future<Output = Option<Option<u32>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn override_max_videos_per_call<'life0, 'life1, 'async_trait>(
&'life0 self,
_inner: &'life1 dyn VideoModel,
) -> Pin<Box<dyn Future<Output = Option<Option<u32>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Override VideoModel::max_videos_per_call.
Sourcefn transform_params<'life0, 'life1, 'async_trait>(
&'life0 self,
params: VideoOptions,
_inner: &'life1 dyn VideoModel,
) -> Pin<Box<dyn Future<Output = Result<VideoOptions>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn transform_params<'life0, 'life1, 'async_trait>(
&'life0 self,
params: VideoOptions,
_inner: &'life1 dyn VideoModel,
) -> Pin<Box<dyn Future<Output = Result<VideoOptions>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Transform the video options before they reach the inner model.
§Errors
Return a crate::ProviderError to fail the call without invoking
the model.
Sourcefn wrap_generate<'life0, 'life1, 'async_trait>(
&'life0 self,
next: &'life1 dyn VideoModel,
params: VideoOptions,
) -> Pin<Box<dyn Future<Output = Result<VideoResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn wrap_generate<'life0, 'life1, 'async_trait>(
&'life0 self,
next: &'life1 dyn VideoModel,
params: VideoOptions,
) -> Pin<Box<dyn Future<Output = Result<VideoResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Wrap a video-generation call.
Default: forwards to next.do_generate(params).
§Errors
Returns whatever error next returns, or a middleware-introduced
failure.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".