pub enum RerankError {
EmptyCandidates,
TooManyCandidates {
actual: usize,
limit: usize,
},
Engine(String),
SignalError(String, String),
Config(String),
Api(String),
WeightSumInvalid(f32),
MissingQueryEmbedding,
}Expand description
重排序错误
Variants§
EmptyCandidates
候选项列表为空,无法执行重排序
TooManyCandidates
候选项数量超过限制
Engine(String)
重排序引擎内部错误
SignalError(String, String)
信号计算过程中发生错误
Config(String)
配置参数无效
Api(String)
远程 API 调用失败
WeightSumInvalid(f32)
信号权重之和不为 1.0
MissingQueryEmbedding
需要 query embedding 但未提供(vector_similarity 信号需要外部传入)
Implementations§
Source§impl RerankError
impl RerankError
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
判断错误是否可重试
返回 true 表示该错误为临时性错误(如 API 调用失败、引擎内部错误),
调用方可以安全地重试操作。返回 false 表示该错误不可恢复。
Trait Implementations§
Source§impl Debug for RerankError
impl Debug for RerankError
Source§impl Display for RerankError
impl Display for RerankError
Source§impl Error for RerankError
impl Error for RerankError
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()
Auto Trait Implementations§
impl Freeze for RerankError
impl RefUnwindSafe for RerankError
impl Send for RerankError
impl Sync for RerankError
impl Unpin for RerankError
impl UnsafeUnpin for RerankError
impl UnwindSafe for RerankError
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