Rust SDK reference
The atl crate. Each module has its own page; the crate root is below.
| Module | Covers |
|---|---|
| atl::callback | Callback slots: lets Rust closures stand in where the game expects a callback method name. |
| atl::math | Math helpers and the value types Vec3, Quat, Color and Uuid. Their math runs in WASM. |
| atl::script | Script classes: the Rust traits for parts, tools, characters, worlds, games and terrain, split server/client classes, and the registration that exposes them. |
| atl::sm | The core Scrap Mechanic API: game object types (Shape, Body, Interactable, Character, Player, World, ...) and the sm.* namespaces that operate on them. |
| atl::sys | Raw bindings to the loader's GDT imports (the "atl" import module), as in the C SDK's atl.h. |
| atl::value | atl::Value: a handle to a Lua value, and the conversions between Rust and Lua types. |
| atl::wire | atl::wire: the binary encoding of typed network messages and saved state. |
| atl::prelude | Everything a mod usually needs. |
| atl-macros | #[atl::class], #[atl::server], #[atl::client], #[derive(atl::Message)] |
export_mod!
Section titled "export_mod!"Exports T (a Mod) as the mod-wide lifecycle.
global!
Section titled "global!"A Value for a global path, looked up once and cached, e.g. global!("sm.game.getDifficulty").
object!
Section titled "object!"Declares a game object type over Value, with its Lua type name, e.g. atl::object!(pub Widget = "Widget").
Logs an info line.
Logs a warning.
error!
Section titled "error!"Logs an error.
SdkVersion
Section titled "SdkVersion"pub struct SdkVersionFields
pub major: u32pub minor: u32pub micro: u32Functions
Section titled "Functions"pub fn mod_id() -> alloc::string::StringThis mod's id.
Constants
Section titled "Constants"pub const SDK_VERSION: SdkVersion = SdkVersion { major: 1, minor: 0, micro: 0, }Re-exports
Section titled "Re-exports"atl_macros::classatl_macros::clientatl_macros::serveratl_macros::Messagevalue::invokevalue::invoke_methodvalue::lua_errorvalue::Argvalue::Argsvalue::FromLuavalue::GlobalCellvalue::IntoLuavalue::Keyvalue::Nilvalue::Objectvalue::Pairsvalue::Typevalue::Value