pub struct ProviderFailure {
pub kind: ProviderFailureKind,
pub message: String,
pub retryable: bool,
pub status: Option<u16>,
pub raw: Option<String>,
pub code: Option<String>,
pub terminal_reason: LlmTerminalReason,
pub headers: Vec<(String, String)>,
pub retry_after: Option<Duration>,
pub request_body: Option<String>,
}Fields§
§kind: ProviderFailureKind§message: String§retryable: bool§status: Option<u16>§raw: Option<String>§code: Option<String>§terminal_reason: LlmTerminalReason§headers: Vec<(String, String)>§retry_after: Option<Duration>§request_body: Option<String>Implementations§
Source§impl ProviderFailure
impl ProviderFailure
pub fn new(message: impl Into<String>) -> Self
pub fn with_kind(self, kind: ProviderFailureKind) -> Self
pub fn retryable(self, retryable: bool) -> Self
pub fn with_status(self, status: u16) -> Self
pub fn with_raw(self, raw: impl Into<String>) -> Self
pub fn with_code(self, code: impl Into<String>) -> Self
pub fn with_terminal_reason(self, reason: LlmTerminalReason) -> Self
pub fn with_headers<I, K, V>(self, headers: I) -> Self
pub fn with_retry_after(self, retry_after: Duration) -> Self
pub fn with_request_body(self, request_body: impl Into<String>) -> Self
Trait Implementations§
Source§impl Clone for ProviderFailure
impl Clone for ProviderFailure
Source§fn clone(&self) -> ProviderFailure
fn clone(&self) -> ProviderFailure
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 ProviderFailure
impl Debug for ProviderFailure
Source§impl Display for ProviderFailure
impl Display for ProviderFailure
Source§impl Error for ProviderFailure
impl Error for ProviderFailure
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<ProviderFailure> for DirectLlmError
impl From<ProviderFailure> for DirectLlmError
Source§fn from(source: LlmTransportError) -> Self
fn from(source: LlmTransportError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ProviderFailure
impl RefUnwindSafe for ProviderFailure
impl Send for ProviderFailure
impl Sync for ProviderFailure
impl Unpin for ProviderFailure
impl UnsafeUnpin for ProviderFailure
impl UnwindSafe for ProviderFailure
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<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> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more