Skip to main content

ImageProvider

Trait ImageProvider 

Source
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§

Source

fn descriptor(&self) -> ProviderDescriptor

Returns stable provider identity.

Source

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.

Source

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.

Source

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§

Source

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.

Source

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.

Source

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.

Source

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.

Source

fn shutdown<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), BridgeError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Releases provider resources during graceful shutdown.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§