#[non_exhaustive]pub enum TestkitError {
Io(Error),
ReplayExhausted {
requested: usize,
},
ReplayNoMatch {
left: usize,
},
Inner(ProviderError),
}Expand description
lc-testkit 统一错误。
通过 [From<TestkitError> for ProviderError] 桥接,让录播/回放 provider
可以直接喂给 chains 等要求 L::Error: Into<ProviderError> 的泛型入口。
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Io(Error)
录制/回放过程中的 IO 错误(读文件、写文件等)。
ReplayExhausted
回放队列耗尽:请求条数超过录制条数。
ReplayNoMatch
ReplayStrategy::Exact 下请求消息签名在录播中无匹配(显式报错,不做
静默 FIFO 兜底);left 为队列剩余条数,便于排查录播与请求的字段漂移。
Inner(ProviderError)
内层模型错误,无损透传真实 provider 错误。
Trait Implementations§
Source§impl Debug for TestkitError
impl Debug for TestkitError
Source§impl Display for TestkitError
impl Display for TestkitError
Source§impl Error for TestkitError
impl Error for TestkitError
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<Error> for TestkitError
impl From<Error> for TestkitError
Source§impl From<ProviderError> for TestkitError
impl From<ProviderError> for TestkitError
Source§fn from(source: ProviderError) -> Self
fn from(source: ProviderError) -> Self
Converts to this type from the input type.
Source§impl From<TestkitError> for ProviderError
impl From<TestkitError> for ProviderError
Source§fn from(e: TestkitError) -> Self
fn from(e: TestkitError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for TestkitError
impl !UnwindSafe for TestkitError
impl Freeze for TestkitError
impl Send for TestkitError
impl Sync for TestkitError
impl Unpin for TestkitError
impl UnsafeUnpin for TestkitError
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