Skip to main content

Crate arty_macros

Crate arty_macros 

Source
Expand description

Entry-point macros for arty.

Enable Arty’s macros feature and use #[arty::main] or #[arty::test]. You do not need to depend on this companion crate directly.

Both attributes start a runtime, pass its worker capabilities to an async function, and shut down when that function returns. The optional workers = N argument starts exactly N async worker threads. Multiple workers share processors when N exceeds available processor capacity; workers = all selects all available processors. Both attributes use one worker by default.

The monitor = enabled and monitor = disabled arguments select the monitoring policy. #[arty::main] defaults to enabled. #[arty::test] defaults to disabled so future monitor activation stays out of ordinary tests. The panic = shutdown and panic = ignore arguments select the runtime panic policy. Both attributes default to shutdown.

The application-facing references are arty::main and arty::test. They contain runnable examples, configuration syntax, and failure conditions.

Attribute Macros§

main
Runs an async entry point on an Arty runtime.
test
Runs an async test on an Arty runtime.