pub struct ProviderHandle { /* private fields */ }Expand description
Owning handle to provider components. This is an executable transport handle supplied by the host, not a persistence format.
Implementations§
Source§impl ProviderHandle
impl ProviderHandle
pub fn new(components: ProviderComponents) -> ProviderHandle
pub fn unconfigured() -> ProviderHandle
pub fn components(&self) -> &ProviderComponents
pub fn components_mut(&mut self) -> &mut ProviderComponents
pub fn with_clock(self, clock: Arc<dyn Clock>) -> ProviderHandle
pub fn kind(&self) -> &'static str
pub fn supported_variants(&self, model: &str) -> &'static [&'static str]
pub fn validate_variant(&self, model: &str, variant: &str) -> Result<(), String>
pub fn options(&self) -> ProviderOptions
pub fn set_options(&mut self, options: ProviderOptions)
pub fn requires_streaming(&self) -> bool
pub async fn complete( &mut self, request: LlmRequest, ) -> Result<LlmResponse, ProviderFailure>
Sourcepub async fn close(&self) -> Result<(), ProviderFailure>
pub async fn close(&self) -> Result<(), ProviderFailure>
Release the underlying provider’s host-visible transport resources.
This forwards to Provider::close. Hosts that want a graceful
transport shutdown (for example, sending WebSocket Close frames on
cached Codex sessions) retain a clone of the handle they hand to the
core and call this before process exit. Providers with no reusable
transport state close as a no-op.
pub fn to_spec(&self) -> ProviderSpec
Trait Implementations§
Source§impl Clone for ProviderHandle
impl Clone for ProviderHandle
Source§fn clone(&self) -> ProviderHandle
fn clone(&self) -> ProviderHandle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProviderHandle
impl Debug for ProviderHandle
impl Eq for ProviderHandle
Source§impl PartialEq for ProviderHandle
impl PartialEq for ProviderHandle
Source§fn eq(&self, other: &ProviderHandle) -> bool
fn eq(&self, other: &ProviderHandle) -> bool
Tests for
self and other values to be equal, and is used by ==.Auto Trait Implementations§
impl !RefUnwindSafe for ProviderHandle
impl !UnwindSafe for ProviderHandle
impl Freeze for ProviderHandle
impl Send for ProviderHandle
impl Sync for ProviderHandle
impl Unpin for ProviderHandle
impl UnsafeUnpin for ProviderHandle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more