pub trait ImageProvider: Send + Sync {
// Required methods
fn descriptor(&self) -> ProviderDescriptor;
fn capabilities<'life0, 'life1, 'async_trait>(
&'life0 self,
model: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<ProviderCapabilities, BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn execute<'life0, 'async_trait>(
&'life0 self,
request: ImageRequest,
context: ProviderContext,
) -> Pin<Box<dyn Future<Output = Result<ImageResponse, BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn check_ready<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn execute_stream<'life0, 'async_trait>(
&'life0 self,
_request: ImageRequest,
_context: ProviderContext,
) -> Pin<Box<dyn Future<Output = Result<ProviderEventStream, BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn get_session<'life0, 'life1, 'async_trait>(
&'life0 self,
_key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<SessionMetadata, BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn delete_session<'life0, 'life1, 'async_trait>(
&'life0 self,
_key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn restart_count(&self) -> Option<u64> { ... }
fn shutdown<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
Provider-neutral image backend.
Required Methods§
Sourcefn descriptor(&self) -> ProviderDescriptor
fn descriptor(&self) -> ProviderDescriptor
Returns stable provider identity.
Sourcefn capabilities<'life0, 'life1, 'async_trait>(
&'life0 self,
model: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<ProviderCapabilities, BridgeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn capabilities<'life0, 'life1, 'async_trait>(
&'life0 self,
model: Option<&'life1 str>,
) -> Pin<Box<dyn Future<Output = Result<ProviderCapabilities, BridgeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns current capabilities for an optional model.
Sourcefn execute<'life0, 'async_trait>(
&'life0 self,
request: ImageRequest,
context: ProviderContext,
) -> Pin<Box<dyn Future<Output = Result<ImageResponse, BridgeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
request: ImageRequest,
context: ProviderContext,
) -> Pin<Box<dyn Future<Output = Result<ImageResponse, BridgeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Executes one normalized request without exposing incremental events.
Sourcefn check_ready<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn check_ready<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Performs a non-generating auth/readiness check.
Provided Methods§
Sourcefn execute_stream<'life0, 'async_trait>(
&'life0 self,
_request: ImageRequest,
_context: ProviderContext,
) -> Pin<Box<dyn Future<Output = Result<ProviderEventStream, BridgeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute_stream<'life0, 'async_trait>(
&'life0 self,
_request: ImageRequest,
_context: ProviderContext,
) -> Pin<Box<dyn Future<Output = Result<ProviderEventStream, BridgeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Starts a request with incremental events when supported.
Sourcefn get_session<'life0, 'life1, 'async_trait>(
&'life0 self,
_key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<SessionMetadata, BridgeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_session<'life0, 'life1, 'async_trait>(
&'life0 self,
_key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<SessionMetadata, BridgeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Looks up caller-visible persistent session metadata when supported.
Sourcefn delete_session<'life0, 'life1, 'async_trait>(
&'life0 self,
_key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_session<'life0, 'life1, 'async_trait>(
&'life0 self,
_key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Deletes a persistent session binding when supported.
Sourcefn restart_count(&self) -> Option<u64>
fn restart_count(&self) -> Option<u64>
Returns the number of supervised provider process restarts when exposed.
Implementations must return only a monotonic low-cardinality counter.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".