pub struct JsonRejection { /* private fields */ }Expand description
Rejection returned when JSON deserialization fails.
This rejection provides structured information about the deserialization error, including the path to the failing field when available.
§Example
use tower_mcp::extract::JsonRejection;
let rejection = JsonRejection::new("missing field `name`");
assert!(rejection.message().contains("name"));Implementations§
Trait Implementations§
Source§impl Clone for JsonRejection
impl Clone for JsonRejection
Source§fn clone(&self) -> JsonRejection
fn clone(&self) -> JsonRejection
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for JsonRejection
impl Debug for JsonRejection
Source§impl Display for JsonRejection
impl Display for JsonRejection
Source§impl Error for JsonRejection
impl Error for JsonRejection
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<Error> for JsonRejection
impl From<Error> for JsonRejection
Source§impl From<JsonRejection> for Error
impl From<JsonRejection> for Error
Source§fn from(rejection: JsonRejection) -> Self
fn from(rejection: JsonRejection) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for JsonRejection
impl RefUnwindSafe for JsonRejection
impl Send for JsonRejection
impl Sync for JsonRejection
impl Unpin for JsonRejection
impl UnwindSafe for JsonRejection
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