pub struct JsError { /* private fields */ }Expand description
A JavaScript Error object.
This type is used to create JavaScript Error objects that can be thrown or returned.
Implementations§
Trait Implementations§
Source§impl Error for JsError
impl Error for JsError
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 JsCast for JsError
impl JsCast for JsError
Source§fn instanceof(val: &JsValue) -> bool
fn instanceof(val: &JsValue) -> bool
Check if a JsValue is an instance of this type. Read more
Source§fn unchecked_from_js(val: JsValue) -> JsError
fn unchecked_from_js(val: JsValue) -> JsError
Unchecked cast from JsValue to this type. Read more
Source§fn unchecked_from_js_ref(val: &JsValue) -> &JsError
fn unchecked_from_js_ref(val: &JsValue) -> &JsError
Unchecked cast from a JsValue reference to a reference of this type. Read more
Source§fn is_type_of(val: &JsValue) -> bool
fn is_type_of(val: &JsValue) -> bool
Performs a dynamic type check to see whether the
JsValue provided
is a value of this type. Read moreSource§fn has_type<T>(&self) -> boolwhere
T: JsCast,
fn has_type<T>(&self) -> boolwhere
T: JsCast,
Test whether this JS value has a type
T. Read moreSource§fn dyn_into<T>(self) -> Result<T, Self>where
T: JsCast,
fn dyn_into<T>(self) -> Result<T, Self>where
T: JsCast,
Try to cast this value to type T. Read more
Source§fn dyn_ref<T>(&self) -> Option<&T>where
T: JsCast,
fn dyn_ref<T>(&self) -> Option<&T>where
T: JsCast,
Try to get a reference to type T from this value. Read more
Source§fn is_instance_of<T>(&self) -> boolwhere
T: JsCast,
fn is_instance_of<T>(&self) -> boolwhere
T: JsCast,
Test whether this JS value is an instance of the type
T. Read moreSource§fn unchecked_into<T>(self) -> Twhere
T: JsCast,
fn unchecked_into<T>(self) -> Twhere
T: JsCast,
Unchecked cast to another type.
Source§fn unchecked_ref<T>(&self) -> &Twhere
T: JsCast,
fn unchecked_ref<T>(&self) -> &Twhere
T: JsCast,
Unchecked cast to a reference of another type.
Auto Trait Implementations§
impl Freeze for JsError
impl RefUnwindSafe for JsError
impl Send for JsError
impl Sync for JsError
impl Unpin for JsError
impl UnwindSafe for JsError
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
Source§impl<T> RefFromBinaryDecode for Twhere
T: JsCast + 'static,
impl<T> RefFromBinaryDecode for Twhere
T: JsCast + 'static,
Source§type Anchor = JsCastAnchor<T>
type Anchor = JsCastAnchor<T>
The anchor type that keeps the decoded reference valid.
Source§fn ref_decode(
_decoder: &mut DecodedData<'_>,
) -> Result<<T as RefFromBinaryDecode>::Anchor, DecodeError>
fn ref_decode( _decoder: &mut DecodedData<'_>, ) -> Result<<T as RefFromBinaryDecode>::Anchor, DecodeError>
Decode a reference anchor from binary data.