Sha256: 54eb68c9a898a5c80d2bfcf57bfbedee19869cd531fae1f307be7978bc8fde64

Contents?: true

Size: 1.19 KB

Versions: 27

Compression:

Stored size: 1.19 KB

Contents

//! windows-specific extension for the `wasmtime` crate.
//!
//! This module is only available on Windows targets.
//! It is not available on Linux or macOS, for example. Note that the import path for
//! this module is `wasmtime::windows::...`, which is intended to emphasize that it
//! is platform-specific.
//!
//! The traits contained in this module are intended to extend various types
//! throughout the `wasmtime` crate with extra functionality that's only
//! available on Windows.

use crate::{AsContextMut, Store};
use windows_sys::Win32::System::Diagnostics::Debug::EXCEPTION_POINTERS;

/// Extensions for the [`Store`] type only available on Windows.
pub trait StoreExt {
    /// Configures a custom signal handler to execute.
    ///
    /// TODO: needs more documentation.
    unsafe fn set_signal_handler<H>(&mut self, handler: H)
    where
        H: 'static + Fn(*mut EXCEPTION_POINTERS) -> bool + Send + Sync;
}

impl<T> StoreExt for Store<T> {
    unsafe fn set_signal_handler<H>(&mut self, handler: H)
    where
        H: 'static + Fn(*mut EXCEPTION_POINTERS) -> bool + Send + Sync,
    {
        self.as_context_mut()
            .0
            .set_signal_handler(Some(Box::new(handler)));
    }
}

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
wasmtime-20.0.2 ./ext/cargo-vendor/wasmtime-20.0.2/src/runtime/windows.rs
wasmtime-20.0.0 ./ext/cargo-vendor/wasmtime-20.0.0/src/runtime/windows.rs
wasmtime-18.0.3 ./ext/cargo-vendor/wasmtime-18.0.3/src/runtime/windows.rs
wasmtime-17.0.1 ./ext/cargo-vendor/wasmtime-17.0.1/src/windows.rs
wasmtime-17.0.0 ./ext/cargo-vendor/wasmtime-17.0.0/src/windows.rs
wasmtime-16.0.0 ./ext/cargo-vendor/wasmtime-16.0.0/src/windows.rs
wasmtime-15.0.1 ./ext/cargo-vendor/wasmtime-15.0.1/src/windows.rs
wasmtime-15.0.0 ./ext/cargo-vendor/wasmtime-15.0.0/src/windows.rs
wasmtime-14.0.4 ./ext/cargo-vendor/wasmtime-14.0.4/src/windows.rs
wasmtime-14.0.3 ./ext/cargo-vendor/wasmtime-14.0.3/src/windows.rs
wasmtime-14.0.1 ./ext/cargo-vendor/wasmtime-14.0.1/src/windows.rs
wasmtime-14.0.0 ./ext/cargo-vendor/wasmtime-14.0.0/src/windows.rs
wasmtime-13.0.0 ./ext/cargo-vendor/wasmtime-13.0.0/src/windows.rs
wasmtime-12.0.1 ./ext/cargo-vendor/wasmtime-12.0.1/src/windows.rs
wasmtime-12.0.0 ./ext/cargo-vendor/wasmtime-12.0.0/src/windows.rs
wasmtime-11.0.0 ./ext/cargo-vendor/wasmtime-11.0.0/src/windows.rs
wasmtime-10.0.1 ./ext/cargo-vendor/wasmtime-10.0.1/src/windows.rs
wasmtime-10.0.0 ./ext/cargo-vendor/wasmtime-10.0.0/src/windows.rs
wasmtime-9.0.4 ./ext/cargo-vendor/wasmtime-9.0.4/src/windows.rs
wasmtime-9.0.1 ./ext/cargo-vendor/wasmtime-9.0.1/src/windows.rs