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) -> Self
pub fn unconfigured() -> Self
pub fn components(&self) -> &ProviderComponents
pub fn components_mut(&mut self) -> &mut ProviderComponents
pub fn with_clock(self, clock: Arc<dyn Clock>) -> Self
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, LlmTransportError>
Sourcepub async fn close(&self) -> Result<(), LlmTransportError>
pub async fn close(&self) -> Result<(), LlmTransportError>
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§impl Debug for ProviderHandle
impl Debug for ProviderHandle
impl Eq for ProviderHandle
Source§impl PartialEq for ProviderHandle
impl PartialEq for ProviderHandle
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