Attribute Macro main
#[main]Available on crate feature
macros only.Expand description
Run an async fn main on a runtime of its own.
The body becomes the future handed to Runtime::block_on, and the arguments
configure what it is handed to:
crate = pathnames the crate to reach the runtime through, for acompiothat is renamed or reached through another crate;- any other
name = valuebecomes aRuntimeBuildermethod call, as does everyname = valuewithinwith_proactor(..)on theProactorBuilder; consoleinstallsconsole_subscriber::init()before the runtime runs. The caller needs a dependency onconsole-subscriberfor it to be there to install, theconsole_without_tokio_unstablerustflag for the install not to panic on the way up, and theconsolefeature for there to be any instrumentation for it to report on. Only the first of the three can be checked from here; see theconsolemodule for the other two.
ⓘ
#[compio::main(event_interval = 8, with_proactor(capacity = 1024))]
async fn main() {
// ...
}