pub enum RpcRequestParsingError {
RequestInvalidType {
actual_type: String,
},
ParamsInvalidType {
actual_type: String,
},
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,
},
NotificationHasId {
method: Option<String>,
id: Value,
},
MethodInvalid {
actual: String,
},
IdMissing {
method: Option<String>,
},
IdInvalid {
actual: String,
cause: 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§
RequestInvalidType
ParamsInvalidType
VersionMissing
VersionInvalid
MethodMissing
MethodInvalidType
NotificationHasId
MethodInvalid
IdMissing
IdInvalid
Parse(Error)
Trait Implementations§
Source§impl Debug for RpcRequestParsingError
impl Debug for RpcRequestParsingError
Source§impl Display for RpcRequestParsingError
impl Display for RpcRequestParsingError
Source§impl Error for RpcRequestParsingError
impl Error for RpcRequestParsingError
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<RpcRequestParsingError> for RpcResponseParsingError
impl From<RpcRequestParsingError> for RpcResponseParsingError
Source§fn from(e: RpcRequestParsingError) -> Self
fn from(e: RpcRequestParsingError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for RpcRequestParsingError
impl !RefUnwindSafe for RpcRequestParsingError
impl Send for RpcRequestParsingError
impl Sync for RpcRequestParsingError
impl Unpin for RpcRequestParsingError
impl !UnwindSafe for RpcRequestParsingError
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