pub enum V8Error {
Truncated {
offset: usize,
needed: usize,
available: usize,
},
BadVersion {
offset: usize,
found: u8,
},
UnsupportedTag {
offset: usize,
tag: u8,
},
HostObject {
offset: usize,
blink_tag: u8,
},
BadReference {
offset: usize,
id: u64,
},
BadVarint {
offset: usize,
},
OddUtf16 {
offset: usize,
len: usize,
},
BadKey {
offset: usize,
},
DepthCap {
offset: usize,
cap: usize,
},
NodeCap {
cap: usize,
},
LengthCap {
offset: usize,
len: u64,
cap: usize,
},
}Expand description
A decode failure. Every arm names what failed and where (byte offset), and surfaces the offending value (tag byte / id) so an analyst can identify it — an “unknown” is never reported without the bytes that were actually there.
Variants§
Truncated
Fewer bytes remained than the value required.
BadVersion
The stream did not open with the 0xFF version tag.
UnsupportedTag
A tag byte is not a value-introducing V8 serialization tag we decode.
HostObject
A kHostObject (\\) embedder value (Blink DOM type or a node typed-array
delegate). Surfaced with the following Blink tag byte, not fabricated.
BadReference
A kObjectReference pointed at an id that was never assigned.
BadVarint
A varint ran past 10 bytes / would overflow u64.
OddUtf16
A kTwoByteString had an odd byte length (not whole UTF-16 units).
BadKey
An object/map key was neither a string nor an integer.
DepthCap
Recursion depth exceeded V8Limits::max_depth (DoS guard).
NodeCap
Total materialized nodes exceeded V8Limits::max_nodes (DoS guard).
LengthCap
A declared length exceeded the node cap (e.g. a huge sparse-array length or bigint digit count) — rejected before allocating.
Trait Implementations§
impl Eq for V8Error
Source§impl Error for V8Error
impl Error for V8Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
impl StructuralPartialEq for V8Error
Auto Trait Implementations§
impl Freeze for V8Error
impl RefUnwindSafe for V8Error
impl Send for V8Error
impl Sync for V8Error
impl Unpin for V8Error
impl UnsafeUnpin for V8Error
impl UnwindSafe for V8Error
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.