Struct ModelPinnedProviderBuilder
pub struct ModelPinnedProviderBuilder { /* private fields */ }Expand description
Typed builder for ModelPinnedProvider.
alias is the only positional argument. Both pinned_model and
inner are semantically required at build() time; they moved off
new(...) because two adjacent &str positional args (alias and
pinned_model) had a real swap-risk surface — silently pinning the
wrong provider to the wrong model.
Implementations§
Source§impl ModelPinnedProviderBuilder
impl ModelPinnedProviderBuilder
Sourcepub fn pinned_model(self, model: &str) -> Self
pub fn pinned_model(self, model: &str) -> Self
The model ID every request to this provider is rewritten to. Required.
Sourcepub fn inner(self, inner: Box<dyn ModelProvider>) -> Self
pub fn inner(self, inner: Box<dyn ModelProvider>) -> Self
The inner provider whose model this pin overrides. Required.
Sourcepub fn build(self) -> ModelPinnedProvider
pub fn build(self) -> ModelPinnedProvider
§Panics
Panics if Self::pinned_model or Self::inner was not
called — neither has a sensible default.
Auto Trait Implementations§
impl Freeze for ModelPinnedProviderBuilder
impl !RefUnwindSafe for ModelPinnedProviderBuilder
impl Send for ModelPinnedProviderBuilder
impl Sync for ModelPinnedProviderBuilder
impl Unpin for ModelPinnedProviderBuilder
impl UnsafeUnpin for ModelPinnedProviderBuilder
impl !UnwindSafe for ModelPinnedProviderBuilder
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more