pub enum ActionValidationError {
MissingAction,
MissingField {
field: String,
},
WrongType {
field: String,
},
NotAvailableOverRest {
action: String,
},
UnknownAction {
action: String,
},
}Expand description
Structured validation failures produced while parsing an action request.
Variants§
MissingAction
No action was supplied.
MissingField
A required field was absent or empty.
WrongType
A field was present but had the wrong JSON type (expected a string).
NotAvailableOverRest
The action exists but is MCP-only and cannot be called over REST.
UnknownAction
The requested action name is not recognised.
Implementations§
Source§impl ActionValidationError
impl ActionValidationError
Sourcepub fn code(&self) -> &'static str
pub fn code(&self) -> &'static str
Returns a stable machine-readable error code for this variant.
Sourcepub fn bad_value(&self) -> Option<&str>
pub fn bad_value(&self) -> Option<&str>
Returns the offending action name for action-related variants, if any.
Sourcepub fn remediation(&self) -> String
pub fn remediation(&self) -> String
Returns human-readable guidance for how to fix the request.
Trait Implementations§
Source§impl Debug for ActionValidationError
impl Debug for ActionValidationError
Source§impl Display for ActionValidationError
impl Display for ActionValidationError
Source§impl Error for ActionValidationError
impl Error for ActionValidationError
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()
Source§impl From<ActionValidationError> for ActionError
impl From<ActionValidationError> for ActionError
Source§fn from(source: ActionValidationError) -> Self
fn from(source: ActionValidationError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ActionValidationError
impl RefUnwindSafe for ActionValidationError
impl Send for ActionValidationError
impl Sync for ActionValidationError
impl Unpin for ActionValidationError
impl UnsafeUnpin for ActionValidationError
impl UnwindSafe for ActionValidationError
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