Skip to content

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)]

Exports T (a Mod) as the mod-wide lifecycle.

A Value for a global path, looked up once and cached, e.g. global!("sm.game.getDifficulty").

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.

Logs an error.

pub struct SdkVersion

Fields

pub major: u32
pub minor: u32
pub micro: u32
pub fn mod_id() -> alloc::string::String

This mod's id.

pub const SDK_VERSION: SdkVersion = SdkVersion { major: 1, minor: 0, micro: 0, }
  • atl_macros::class
  • atl_macros::client
  • atl_macros::server
  • atl_macros::Message
  • value::invoke
  • value::invoke_method
  • value::lua_error
  • value::Arg
  • value::Args
  • value::FromLua
  • value::GlobalCell
  • value::IntoLua
  • value::Key
  • value::Nil
  • value::Object
  • value::Pairs
  • value::Type
  • value::Value