samp_sdk/lib.rs
1//! Low-level layer of the `rust-samp` toolkit.
2//!
3//! This crate concentrates two independent sets of bindings:
4//!
5//! - **AMX**: pointers, cell types, function table and error codes of the
6//! Pawn VM used by SA-MP (modules [`raw`], [`amx`], [`cell`], [`args`],
7//! [`error`], [`exports`], [`consts`]).
8//! - **Open Multiplayer**: vtables, binary layout of `IComponent` and typed wrappers
9//! of the native server interfaces (module [`omp`], active while the
10//! `samp-only` feature is not enabled).
11//!
12//! The interface of this crate works on raw pointers and is `unsafe`-friendly.
13//! To write plugins, use the `samp` crate (workspace root) — it re-exports
14//! this SDK and adds the plugin life cycle and native registration via
15//! proc macros (`#[native]`, `initialize_plugin!`, `#[derive(SampPlugin)]`).
16
17pub mod amx;
18pub mod args;
19pub mod call;
20pub mod cell;
21pub mod consts;
22#[cfg(feature = "debug")]
23pub mod debug;
24#[cfg(feature = "encoding")]
25pub mod encoding;
26pub mod error;
27pub mod exports;
28#[doc(hidden)]
29pub mod macros;
30// The open.mp component ABI on Windows uses the `thiscall` calling convention,
31// which only exists on 32-bit x86 — the target SA-MP/open.mp servers actually
32// run on. Compiling it for 64-bit MSVC fails (E0570: unsupported ABI), so the
33// module is skipped there. This lets host-side tooling (e.g. a DAP adapter that
34// only needs `samp::debug`) build for `x86_64-pc-windows-msvc`.
35#[cfg(all(
36 not(feature = "samp-only"),
37 not(all(windows, target_env = "msvc", target_pointer_width = "64"))
38))]
39pub mod omp;
40pub mod raw;
41#[cfg(test)]
42mod tests;