#[non_exhaustive]pub struct ModelFailure<'a> {
pub kind: ModelErrorKind,
pub message: &'a str,
pub retry_after: Option<Duration>,
pub after_first_byte: bool,
}Expand description
Why a model call failed: the protocol client’s classification, carried over as it stands.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.kind: ModelErrorKind§message: &'a str§retry_after: Option<Duration>How long the provider asked to be left alone, when it said.
after_first_byte: boolThe provider had started answering: the client’s backoff no longer covered this call.
Implementations§
Source§impl<'a> ModelFailure<'a>
impl<'a> ModelFailure<'a>
pub fn new(kind: ModelErrorKind, message: &'a str) -> Self
pub fn with_retry_after(self, retry_after: Option<Duration>) -> Self
pub fn with_after_first_byte(self, after_first_byte: bool) -> Self
Trait Implementations§
Source§impl<'a> Clone for ModelFailure<'a>
impl<'a> Clone for ModelFailure<'a>
Source§impl<'a> Debug for ModelFailure<'a>
impl<'a> Debug for ModelFailure<'a>
impl<'a> Eq for ModelFailure<'a>
Source§impl<'a> PartialEq for ModelFailure<'a>
impl<'a> PartialEq for ModelFailure<'a>
impl<'a> StructuralPartialEq for ModelFailure<'a>
Auto Trait Implementations§
impl<'a> Forget for ModelFailure<'a>
impl<'a> Freeze for ModelFailure<'a>
impl<'a> Move for ModelFailure<'a>
impl<'a> RefUnwindSafe for ModelFailure<'a>
impl<'a> Send for ModelFailure<'a>
impl<'a> Sync for ModelFailure<'a>
impl<'a> Unpin for ModelFailure<'a>
impl<'a> UnsafeUnpin for ModelFailure<'a>
impl<'a> UnwindSafe for ModelFailure<'a>
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