Expand description
Proc macros for the rust-samp toolkit.
#[native]— generates theextern "C"FFI wrapper for a Rust function, parsing arguments viaAmxCelland handling the return value.initialize_plugin!— generates the entry points required by the server (Supports/Load/Unload/AmxLoad/AmxUnload/ProcessTickon SA-MP andComponentEntryPoint+ vtable on Open Multiplayer), as well as native registration.#[derive(SampPlugin)]— shortcut for an emptyimpl SampPlugin for T {}.
This crate only compiles when loaded by samp via reexport — it has no
runtime API of its own.
Macros§
- initialize_
plugin - Generates the entry points required by the server (SA-MP + Open Multiplayer), the Rust
IComponentvtable and the registration of the plugin’s native list.
Attribute Macros§
- native
- Generates the
extern "C"wrapper that reads the AMX argument table, parses it into the Rust types declared in the signature and invokes the marked method.
Derive Macros§
- Samp
Plugin - Generates
impl SampPlugin for T {}with all methods using the default behavior (empty). Use for structs that do not need to customize any lifecycle callback — write theimpl SampPluginmanually when some method needs custom logic.