pub struct PinnedClient { /* private fields */ }Expand description
InferenceClient middleware enforcing a ModelPin.
Implementations§
Source§impl PinnedClient
impl PinnedClient
pub fn new( inner: Arc<dyn InferenceClient>, resolver: Arc<dyn ModelResolver>, ) -> Self
Sourcepub fn pin_model(self, pin: ModelPin) -> Self
pub fn pin_model(self, pin: ModelPin) -> Self
Pin the model (see crate::Agent wiring as pin_model).
Sourcepub fn refuse_on_drift(self, refuse: bool) -> Self
pub fn refuse_on_drift(self, refuse: bool) -> Self
Make drift a hard refusal in addition to an emitted event.
pub fn with_telemetry( self, telemetry: Telemetry, run_id: impl Into<String>, ) -> Self
Sourcepub fn pin(&self) -> Option<&ModelPin>
pub fn pin(&self) -> Option<&ModelPin>
The pin this client carries, if any (for stamping into records).
Sourcepub fn revalidate(&self) -> Option<DriftKind>
pub fn revalidate(&self) -> Option<DriftKind>
Re-validate the pin against a freshly resolved version (heartbeat). Returns the drift kind if the provider has drifted.
Trait Implementations§
Source§impl InferenceClient for PinnedClient
impl InferenceClient for PinnedClient
Auto Trait Implementations§
impl !RefUnwindSafe for PinnedClient
impl !UnwindSafe for PinnedClient
impl Freeze for PinnedClient
impl Send for PinnedClient
impl Sync for PinnedClient
impl Unpin for PinnedClient
impl UnsafeUnpin for PinnedClient
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