Skip to main content

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 cell;
20pub mod consts;
21#[cfg(feature = "debug")]
22pub mod debug;
23#[cfg(feature = "encoding")]
24pub mod encoding;
25pub mod error;
26pub mod exports;
27#[doc(hidden)]
28pub mod macros;
29// The open.mp component ABI on Windows uses the `thiscall` calling convention,
30// which only exists on 32-bit x86 — the target SA-MP/open.mp servers actually
31// run on. Compiling it for 64-bit MSVC fails (E0570: unsupported ABI), so the
32// module is skipped there. This lets host-side tooling (e.g. a DAP adapter that
33// only needs `samp::debug`) build for `x86_64-pc-windows-msvc`.
34#[cfg(all(
35    not(feature = "samp-only"),
36    not(all(windows, target_env = "msvc", target_pointer_width = "64"))
37))]
38pub mod omp;
39pub mod raw;
40#[cfg(test)]
41mod tests;