pub struct NoSuchModelError {
pub provider: Option<ProviderId>,
pub model_id: String,
pub model_kind: ModelKind,
pub message: String,
}Expand description
The requested model does not exist or the provider has no models of that kind.
Fields§
§provider: Option<ProviderId>Provider that was asked, if known.
model_id: StringRequested model id.
model_kind: ModelKindRequested model kind.
message: StringExplanation.
Implementations§
Source§impl NoSuchModelError
impl NoSuchModelError
Sourcepub fn new(model_id: impl Into<String>, model_kind: ModelKind) -> Self
pub fn new(model_id: impl Into<String>, model_kind: ModelKind) -> Self
Creates an error for an unknown model_id of model_kind.
Sourcepub fn with_provider(self, provider: &ProviderId) -> Self
pub fn with_provider(self, provider: &ProviderId) -> Self
Attaches the provider that was asked.
Sourcepub fn unsupported_kind(
provider: &ProviderId,
model_id: &str,
model_kind: ModelKind,
) -> Self
pub fn unsupported_kind( provider: &ProviderId, model_id: &str, model_kind: ModelKind, ) -> Self
Creates an error stating that provider exposes no models of model_kind.
Sourcepub fn with_message(self, message: impl Into<String>) -> Self
pub fn with_message(self, message: impl Into<String>) -> Self
Overrides the message.
Trait Implementations§
Source§impl Clone for NoSuchModelError
impl Clone for NoSuchModelError
Source§fn clone(&self) -> NoSuchModelError
fn clone(&self) -> NoSuchModelError
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 NoSuchModelError
impl Debug for NoSuchModelError
Source§impl Display for NoSuchModelError
impl Display for NoSuchModelError
impl Eq for NoSuchModelError
Source§impl Error for NoSuchModelError
impl Error for NoSuchModelError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<Box<NoSuchModelError>> for ProviderError
impl From<Box<NoSuchModelError>> for ProviderError
Source§fn from(error: Box<NoSuchModelError>) -> Self
fn from(error: Box<NoSuchModelError>) -> Self
Converts to this type from the input type.
Source§impl From<NoSuchModelError> for ProviderError
impl From<NoSuchModelError> for ProviderError
Source§fn from(error: NoSuchModelError) -> Self
fn from(error: NoSuchModelError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for NoSuchModelError
impl PartialEq for NoSuchModelError
impl StructuralPartialEq for NoSuchModelError
Auto Trait Implementations§
impl Freeze for NoSuchModelError
impl RefUnwindSafe for NoSuchModelError
impl Send for NoSuchModelError
impl Sync for NoSuchModelError
impl Unpin for NoSuchModelError
impl UnsafeUnpin for NoSuchModelError
impl UnwindSafe for NoSuchModelError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.