Skip to main content

export

Attribute Macro export 

Source
#[export]
Expand description

Publishes a function (or every pub fn in a module) as part of this mod’s cross-mod API.

Control-stage exports are registered with Factorio remote.add_interface. Shared-stage exports remain requireable module functions and are included in the generated api/ stub crate.

Optional remote interface:

  • #[factorio_rs::export(interface)] - remote using the mod name
  • #[factorio_rs::export(interface = "my_iface")] - remote on a custom name

On a mod item, every public function inside inherits the export without needing a per-fn attribute.