#[non_exhaustive]pub enum DriverError {
Invalid {
reason: String,
},
Refused {
reason: String,
},
RateLimited {
reason: String,
retry_after_secs: u64,
},
Unsupported {
driver: String,
operation: String,
},
NotFound {
what: String,
},
Unauthorized {
service: String,
reason: String,
},
Unavailable {
service: String,
reason: String,
},
Protocol {
service: String,
reason: String,
},
NoRecording {
request: String,
},
}Expand description
Why a driver call did not happen (spec 3.5 §7.13).
Converts into AdkError with a drivers.* code, so a tool call that a rule refused
reaches the model as that rule’s reason. Never carries a credential.
§Example
use adk_drivers::DriverError;
let error = DriverError::refused("the recipient unsubscribed");
assert_eq!(error.code(), "drivers.refused");
let adk: adk_core::AdkError = error.into();
assert_eq!(adk.category, adk_core::ErrorCategory::Forbidden);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Invalid
The call’s input is not valid for the contract.
Refused
A rule of the contract refused the call: an unsubscribed recipient, a missing consent receipt, failing domain authentication, a new recipient in a reply.
RateLimited
Too many calls of this kind for now.
Unsupported
The driver does not offer this operation.
NotFound
The thing the call names does not exist.
The service refused the driver’s credentials.
Fields
The service.
What it said.
The service could not be reached or failed.
Protocol
The service answered with something the driver could not read.
NoRecording
A recorded-response driver has no recorded answer for the call.
Implementations§
Source§impl DriverError
impl DriverError
An Unavailable error.
Sourcepub fn unsupported(
driver: impl Into<String>,
operation: impl Into<String>,
) -> Self
pub fn unsupported( driver: impl Into<String>, operation: impl Into<String>, ) -> Self
An Unsupported error.
Trait Implementations§
Source§impl Clone for DriverError
impl Clone for DriverError
Source§impl Debug for DriverError
impl Debug for DriverError
Source§impl Display for DriverError
impl Display for DriverError
impl Eq for DriverError
Source§impl Error for DriverError
impl Error for DriverError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<DriverError> for AdkError
impl From<DriverError> for AdkError
Source§fn from(error: DriverError) -> Self
fn from(error: DriverError) -> Self
Source§impl From<DriverError> for KernelError
impl From<DriverError> for KernelError
Source§fn from(error: DriverError) -> Self
fn from(error: DriverError) -> Self
Source§impl PartialEq for DriverError
impl PartialEq for DriverError
impl StructuralPartialEq for DriverError
Auto Trait Implementations§
impl Forget for DriverError
impl Freeze for DriverError
impl Move for DriverError
impl RefUnwindSafe for DriverError
impl Send for DriverErrorwhere
RawVecInner: Send,
impl Sync for DriverErrorwhere
RawVecInner: Sync,
impl Unpin for DriverError
impl UnsafeUnpin for DriverError
impl UnwindSafe for DriverErrorwhere
RawVecInner: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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
key and return true if they are equal.Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more