Enum rpc_router::RequestParsingError
source · pub enum RequestParsingError {
VersionMissing {
id: Option<Value>,
method: Option<String>,
},
VersionInvalid {
id: Option<Value>,
method: Option<String>,
version: Value,
},
MethodMissing {
id: Option<Value>,
},
MethodInvalidType {
id: Option<Value>,
method: Value,
},
IdMissing {
method: Option<String>,
},
Parse(Error),
}
Expand description
The RPC Request Parsing error is used when utilizing value.try_into()?
or Request::from_value(value)
.
The design intent is to validate and provide as much context as possible when a specific validation fails.
Note: By design, we do not capture the “params” because they could be indefinitely large.
Note: In future releases, the capture of Value objects or arrays for those error variants
will be replaced with Value::String containing a message such as
"[object/array redacted, 'id' must be of type number, string, or equal to null]"
or "[object/array redacted, 'method' must be of type string]"
This approach aims to provide sufficient context for debugging the issue while preventing
the capture of indefinitely large values in the logs.
Variants§
Trait Implementations§
source§impl Debug for RequestParsingError
impl Debug for RequestParsingError
source§impl Display for RequestParsingError
impl Display for RequestParsingError
source§impl Error for RequestParsingError
impl Error for RequestParsingError
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
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()
Auto Trait Implementations§
impl Freeze for RequestParsingError
impl !RefUnwindSafe for RequestParsingError
impl Send for RequestParsingError
impl Sync for RequestParsingError
impl Unpin for RequestParsingError
impl !UnwindSafe for RequestParsingError
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