pub enum ValidationError {
WrongVersion {
expected: u32,
actual: u32,
},
InvalidIdLength {
actual: usize,
},
InvalidActionLength {
actual: usize,
},
ResponseVersionMismatch {
expected: u32,
actual: u32,
},
MalformedResponse,
JsonBudget,
PayloadString {
name: &'static str,
max_bytes: usize,
},
PayloadInteger {
name: &'static str,
min: u64,
max: u64,
},
}Expand description
Envelope validation failure (isDaemonRequest / isBasicResponse).
Variants§
WrongVersion
Frame carried a version this host does not speak.
InvalidIdLength
id is empty or longer than 64 JS string length units.
InvalidActionLength
action is empty or longer than 64 JS string length units.
ResponseVersionMismatch
A response did not echo the requested version.
MalformedResponse
A response carried neither the success nor the failure shape.
JsonBudget
A frame exceeded the JSON node or nesting budget before parsing.
PayloadString
A payload string failed requireString: missing, empty, not a string,
or over the byte cap — one fixed message for all four.
PayloadInteger
A payload number failed requireInteger: not a JS integer or outside
the inclusive range — one fixed message for every failure mode.
Trait Implementations§
Source§impl Clone for ValidationError
impl Clone for ValidationError
Source§impl Debug for ValidationError
impl Debug for ValidationError
Source§impl Display for ValidationError
impl Display for ValidationError
impl Eq for ValidationError
Source§impl Error for ValidationError
impl Error for ValidationError
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 PartialEq for ValidationError
impl PartialEq for ValidationError
impl StructuralPartialEq for ValidationError
Auto Trait Implementations§
impl Forget for ValidationError
impl Freeze for ValidationError
impl Move for ValidationError
impl RefUnwindSafe for ValidationError
impl Send for ValidationError
impl Sync for ValidationError
impl Unpin for ValidationError
impl UnsafeUnpin for ValidationErrorwhere
&'static str: UnsafeUnpin,
impl UnwindSafe for ValidationErrorwhere
&'static str: UnwindSafe,
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