register!() { /* proc-macro */ }Expand description
Registers #[command] functions with a package builder.
use rustra::prelude::*;
#[bridge_type]
struct AddInput { a: i64, b: i64 }
#[bridge_type]
struct AddOutput { sum: i64 }
#[command]
fn add_numbers(input: AddInput) -> Result<AddOutput> {
Ok(AddOutput { sum: input.a + input.b })
}
let pkg = rustra::register!(Package::builder("my.pkg"), add_numbers).build();