Attribute Macro main

#[main]
Expand description

Define a fuchsia main function.

This attribute should be applied to the process main function. It will take care of setting up various Fuchsia crates for the component. If an async function is provided, a fuchsia-async Executor will be used to execute it.

Arguments:

  • threads - worker thread count for a multi-threaded executor. Must be >1 if provided. Defaults to creating a single-threaded executor if omitted.
  • thread_role - name of a scheduler profile for current thread and any async worker threads.
  • logging - boolean toggle for whether to initialize logging (or not). Default true.
  • logging_tags - optional list of string to be used as tags for logs. Default: None.
  • logging_minimum_severity - optional minimum severity to be set for logs. Default: None, the logging library will choose it (typically info).
  • logging_panic_prefix - optional string indicating the panic message prefix to log

The main function can return either () or a Result<(), E> where E is an error type.