screeps_async_macros/lib.rs
1#![warn(missing_docs)]
2
3//! Macros used with screeps-async
4
5mod entry;
6
7use proc_macro::TokenStream;
8
9/// Helper to wrap your main loop entrypoint in code that will automatically configure
10/// the ScreepsRuntime and invoke it at the end of each tick.
11///
12/// The wrapped function may be `async` in which case the body will be passed to
13/// [screeps_async::block_on] before calling [screeps_async::run]
14#[proc_macro_attribute]
15pub fn main(args: TokenStream, item: TokenStream) -> TokenStream {
16 entry::main(args.into(), item.into()).into()
17}