pub enum VerbError {
Unknown {
verb: String,
},
NotFound {
what: String,
},
Reserved {
name: String,
},
NotHere(String),
Invalid(String),
Ambiguous {
said: String,
matches: Vec<String>,
},
Refused(String),
Source(AdkError),
}Expand description
Why a screen action was refused or failed (spec 3.3 §2 item 7, §7.4).
Converts into AdkError with a surface.verb.* code; the web router answers with its
problem document and HTTP status. Every message is plain words a surface may show.
| Variant | Code | Status |
|---|---|---|
Unknown, NotFound | surface.verb.unknown | 404 |
Reserved | surface.verb.reserved | 400 |
NotHere | surface.verb.not_here | 403 |
Invalid | surface.verb.invalid | 400 |
Ambiguous | surface.verb.ambiguous | 409 |
Refused | surface.verb.refused | 409 |
Source | the source’s code | the source’s status |
§Example
use adk_surface::verbs::VerbError;
let error = VerbError::refused("It moved since you saw this");
assert_eq!(error.code(), "surface.verb.refused");
assert_eq!(adk_core::AdkError::from(error).http_status_code(), 409);Variants§
Unknown
No action of that name is offered here.
NotFound
Nothing the caller may act on has that id or title. Also the answer for something that exists but is someone else’s or in another area, so a caller learns nothing about it (spec 3.3 §11 S-I8).
Reserved
The name is one of the decision, agent, governance and resume words no screen action may take (spec 3.3 §7.4, S-I4, S-I10, S-I11).
NotHere(String)
The caller may not take this action from here: a chat channel or the tray, an agent asking for an action only a person takes, or a remote terminal (spec 3.3 §7.2).
Invalid(String)
The request is malformed: a name outside ^[a-z][a-z0-9_]{0,58}$, an object kind the
action does not take, arguments its schema refuses.
Ambiguous
More than one thing matches what was said or typed.
Fields
Refused(String)
The action cannot be taken now: the item started, moved since it was shown, ends too soon, or the governed path refused it.
Source(AdkError)
The kernel or a store failed.
Implementations§
Trait Implementations§
Source§impl Error for VerbError
impl Error for VerbError
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<KernelError> for VerbError
impl From<KernelError> for VerbError
Source§fn from(error: KernelError) -> Self
fn from(error: KernelError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for VerbError
impl !UnwindSafe for VerbError
impl Forget for VerbError
impl Freeze for VerbErrorwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<String>: Freeze,
&'static str: Freeze,
*const ErrorDetails is !null: Freeze,
PhantomData<ErrorDetails>: Freeze,
*const dyn Error + Sync + Send is !null: Freeze,
PhantomData<dyn Error + Sync + Send>: Freeze,
impl Move for VerbError
impl Send for VerbError
impl Sync for VerbError
impl Unpin for VerbError
impl UnsafeUnpin for VerbErrorwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
&'static str: UnsafeUnpin,
*const ErrorDetails is !null: UnsafeUnpin,
PhantomData<ErrorDetails>: UnsafeUnpin,
*const dyn Error + Sync + Send is !null: UnsafeUnpin,
PhantomData<dyn Error + Sync + Send>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
Source§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> 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> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more