#[repr(C)]pub struct AutoSaveExceptionState {
pub context: *mut JSContext,
pub status: ExceptionStatus,
pub exceptionValue: Rooted<Value>,
pub exceptionStack: Rooted<*mut JSObject>,
}Expand description
Save and later restore the current exception state of a given JSContext. This is useful for implementing behavior in C++ that’s like try/catch or try/finally in JS.
Typical usage:
bool ok = JS::Evaluate(cx, ...);
AutoSaveExceptionState savedExc(cx);
... cleanup that might re-enter JS ...
return ok;Fields§
§context: *mut JSContext§status: ExceptionStatus§exceptionValue: Rooted<Value>§exceptionStack: Rooted<*mut JSObject>Auto Trait Implementations§
impl Freeze for AutoSaveExceptionState
impl RefUnwindSafe for AutoSaveExceptionState
impl !Send for AutoSaveExceptionState
impl !Sync for AutoSaveExceptionState
impl Unpin for AutoSaveExceptionState
impl UnwindSafe for AutoSaveExceptionState
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> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
Creates a filterable data provider with the given name for debugging. Read more
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 64 bytes