pub trait LlmError:
Error
+ Send
+ Sync
+ 'static {
// Provided method
fn kind(&self) -> LlmErrorKind { ... }
}Expand description
Marker trait that every LlmProvider::Error must satisfy.
Equivalent to std::error::Error + Send + Sync + 'static, written as
its own trait so it is:
- searchable in the codebase (grep for
LlmError), - one place to add cross-provider extension methods later, and
- a sticky name in error messages (clippy / rustdoc).
Provided Methods§
Sourcefn kind(&self) -> LlmErrorKind
fn kind(&self) -> LlmErrorKind
Classify this error so a transport (e.g. the harness’s Connect surface) can map it onto an accurate status code — telling retryable (rate-limit / timeout / unavailable) apart from terminal (auth / bad-request) failures instead of collapsing everything to a catch-all.
Defaults to LlmErrorKind::Other; provider error types override it,
and crate::BoxError carries the kind through type erasure.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".