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§
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,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".