Struct wasmer_vm::trap::traphandlers::TrapHandlerContext
source · struct TrapHandlerContext {
inner: *const u8,
handle_trap: fn(_: *const u8, _: usize, _: usize, _: Option<usize>, _: Option<TrapCode>, _: &mut dyn FnMut(TrapHandlerRegs)) -> bool,
custom_trap: Option<*const TrapHandlerFn<'static>>,
}
Expand description
Read-only information that is used by signal handlers to handle and recover from traps.
Fields§
§inner: *const u8
§handle_trap: fn(_: *const u8, _: usize, _: usize, _: Option<usize>, _: Option<TrapCode>, _: &mut dyn FnMut(TrapHandlerRegs)) -> bool
§custom_trap: Option<*const TrapHandlerFn<'static>>
Implementations§
source§impl TrapHandlerContext
impl TrapHandlerContext
sourcefn install<T, R>(
custom_trap: Option<*const TrapHandlerFn<'static>>,
coro_trap_handler: CoroutineTrapHandler<Result<T, UnwindReason>>,
f: impl FnOnce() -> R,
) -> R
fn install<T, R>( custom_trap: Option<*const TrapHandlerFn<'static>>, coro_trap_handler: CoroutineTrapHandler<Result<T, UnwindReason>>, f: impl FnOnce() -> R, ) -> R
Runs the given function with a trap handler context. The previous trap handler context is preserved and restored afterwards.
Auto Trait Implementations§
impl Freeze for TrapHandlerContext
impl !RefUnwindSafe for TrapHandlerContext
impl !Send for TrapHandlerContext
impl !Sync for TrapHandlerContext
impl Unpin for TrapHandlerContext
impl !UnwindSafe for TrapHandlerContext
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.