pub enum ErrorCategory {
Transient,
Resource,
Configuration,
Logic,
System,
UserInterrupt,
}Expand description
错误类型分类
Variants§
Transient
临时错误(网络波动、API 限流)
Resource
资源错误(内存不足、磁盘满)
Configuration
配置错误(API Key 无效、配置缺失)
Logic
逻辑错误(参数错误、工具失败)
System
系统错误(未知错误)
UserInterrupt
用户中断
Implementations§
Source§impl ErrorCategory
impl ErrorCategory
Sourcepub fn from_error_message(msg: &str) -> Self
pub fn from_error_message(msg: &str) -> Self
从错误消息分析类型
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
是否可重试
Trait Implementations§
Source§impl Clone for ErrorCategory
impl Clone for ErrorCategory
Source§fn clone(&self) -> ErrorCategory
fn clone(&self) -> ErrorCategory
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 ErrorCategory
impl Debug for ErrorCategory
impl Eq for ErrorCategory
Source§impl PartialEq for ErrorCategory
impl PartialEq for ErrorCategory
Source§fn eq(&self, other: &ErrorCategory) -> bool
fn eq(&self, other: &ErrorCategory) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ErrorCategory
Auto Trait Implementations§
impl Freeze for ErrorCategory
impl RefUnwindSafe for ErrorCategory
impl Send for ErrorCategory
impl Sync for ErrorCategory
impl Unpin for ErrorCategory
impl UnsafeUnpin for ErrorCategory
impl UnwindSafe for ErrorCategory
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.