pub struct ProviderError { /* private fields */ }Expand description
A model-provider failure with retry metadata preserved for callers.
Implementations§
Source§impl ProviderError
impl ProviderError
Sourcepub fn new(message: impl Into<String>) -> Self
pub fn new(message: impl Into<String>) -> Self
Creates a non-retryable provider failure without an HTTP response.
Sourcepub fn retryable(message: impl Into<String>) -> Self
pub fn retryable(message: impl Into<String>) -> Self
Creates a retryable provider failure without an HTTP response.
Sourcepub fn status(&self) -> Option<u16>
pub fn status(&self) -> Option<u16>
Returns the provider’s HTTP status code, when one was received.
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Reports whether retrying the operation is normally safe.
Sourcepub fn retry_after(&self) -> Option<&str>
pub fn retry_after(&self) -> Option<&str>
Returns the provider’s raw Retry-After header value.
Trait Implementations§
Source§impl Debug for ProviderError
impl Debug for ProviderError
Source§impl Display for ProviderError
impl Display for ProviderError
Source§impl Error for ProviderError
impl Error for ProviderError
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<&str> for ProviderError
impl From<&str> for ProviderError
Source§impl From<ProviderError> for Error
impl From<ProviderError> for Error
Source§fn from(source: ProviderError) -> Self
fn from(source: ProviderError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ProviderError
impl RefUnwindSafe for ProviderError
impl Send for ProviderError
impl Sync for ProviderError
impl Unpin for ProviderError
impl UnsafeUnpin for ProviderError
impl UnwindSafe for ProviderError
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