Skip to main content

Provider

Trait Provider 

Source
pub trait Provider: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn capabilities(&self) -> ProviderCapabilities;
    fn infer<'life0, 'async_trait>(
        &'life0 self,
        request: InferenceRequest,
        cancellation: Option<CancellationToken>,
    ) -> Pin<Box<dyn Future<Output = RuntimeResult<InferenceResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn infer_stream<'life0, 'async_trait>(
        &'life0 self,
        request: InferenceRequest,
        cancellation: Option<CancellationToken>,
    ) -> Pin<Box<dyn Future<Output = RuntimeResult<BoxStream<RuntimeResult<InferenceChunk>>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn name(&self) -> &str

Source

fn capabilities(&self) -> ProviderCapabilities

Source

fn infer<'life0, 'async_trait>( &'life0 self, request: InferenceRequest, cancellation: Option<CancellationToken>, ) -> Pin<Box<dyn Future<Output = RuntimeResult<InferenceResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn infer_stream<'life0, 'async_trait>( &'life0 self, request: InferenceRequest, cancellation: Option<CancellationToken>, ) -> Pin<Box<dyn Future<Output = RuntimeResult<BoxStream<RuntimeResult<InferenceChunk>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§