1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! Windows-specific items: the load-time callback-table handoff and the
//! platform `SysIOVec`.
//!
//! Windows NIFs cannot resolve `enif_*` via `dlsym`; the BEAM passes a callback
//! table to `nif_init`, which [`init`] stores.
use ;
use crate;
/// `TWinDynNifCallbacks` — the callback table the BEAM passes to `nif_init` on
/// Windows, where the `enif_*` symbols are not resolvable via `dlsym`.
///
/// Its leading fields are the `enif_*` function pointers in canonical order —
/// exactly `Api` — followed by an `erts_alc_test` slot the NIF API never
/// uses. Only the leading `Api` is read.
/// Store the BEAM-supplied callback table (Windows). Idempotent.
///
/// Call exactly once from the `nif_init` entry point, before any other function
/// in this crate (the `nif_init!` macro does this for you).
///
/// # Safety
///
/// `callbacks` must be the pointer the BEAM passed to `nif_init`, valid for the
/// duration of the call.
pub unsafe
/// A single base/length I/O segment.
///
/// The element type of an [`IOVec`](crate::IOVec), as produced by
/// [`inspect_iovec`](crate::inspect_iovec). On Windows the fields are swapped and
/// `iov_len` is 32-bit so the struct can be cast directly to a `WSABUF`.
///
/// [`SysIOVec`](https://www.erlang.org/doc/apps/erts/erl_nif.html#SysIOVec) — NIF 2.12 — OTP 20.1