pub struct Backend(/* private fields */);Expand description
What an Agent profile’s backend names: a built-in Provider, or a custom provider
set up on the machine that runs the eval. The project only declares the name.
Implementations§
Source§impl Backend
impl Backend
pub fn as_str(&self) -> &str
Sourcepub fn builtin(&self) -> Option<Provider>
pub fn builtin(&self) -> Option<Provider>
The built-in provider this names, or None for a custom provider.
Sourcepub fn validate_eval(&self) -> Result<(), String>
pub fn validate_eval(&self) -> Result<(), String>
A custom HTTP registration may live on a different machine from the parser.
pub fn selection(&self) -> Result<Selection, String>
Sourcepub fn admit(
&self,
registered: impl FnOnce(&CustomBackendName) -> Result<bool, String>,
) -> Result<(), Failure>
pub fn admit( &self, registered: impl FnOnce(&CustomBackendName) -> Result<bool, String>, ) -> Result<(), Failure>
Check that a Run can admit the declared backend, without resolving credentials. Only custom HTTP names need to be checked against the local provider registrations.
pub fn not_registered(&self) -> String
Sourcepub fn is_reserved_custom(&self) -> bool
pub fn is_reserved_custom(&self) -> bool
Whether this name is reserved and cannot be used for a custom HTTP provider.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Backend
impl<'de> Deserialize<'de> for Backend
Source§fn deserialize<D>(
deserializer: D,
) -> Result<Backend, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Backend, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Backend
Source§impl From<&DirectBackend> for Backend
impl From<&DirectBackend> for Backend
Source§fn from(direct: &DirectBackend) -> Backend
fn from(direct: &DirectBackend) -> Backend
Converts to this type from the input type.
Source§impl From<HttpProvider> for Backend
impl From<HttpProvider> for Backend
Source§fn from(provider: HttpProvider) -> Backend
fn from(provider: HttpProvider) -> Backend
Converts to this type from the input type.
Source§impl Ord for Backend
impl Ord for Backend
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Backend
impl PartialOrd for Backend
Source§impl Serialize for Backend
impl Serialize for Backend
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for Backend
Auto Trait Implementations§
impl Forget for Backend
impl Freeze for Backend
impl Move for Backend
impl RefUnwindSafe for Backend
impl Send for Backendwhere
RawVecInner: Send,
impl Sync for Backendwhere
RawVecInner: Sync,
impl Unpin for Backend
impl UnsafeUnpin for Backend
impl UnwindSafe for Backendwhere
RawVecInner: UnwindSafe,
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoToolOutput for Twhere
T: Serialize + 'static,
impl<T> IntoToolOutput for Twhere
T: Serialize + 'static,
Source§fn into_tool_output(self) -> Result<ToolOutput, ToolExecutionError>
fn into_tool_output(self) -> Result<ToolOutput, ToolExecutionError>
Convert this value without routing structured data through a string.