Function dialog::default_backend

source ·
pub fn default_backend() -> Box<dyn Backend>
Expand description

Creates a new instance of the default backend.

The following steps are performed to determine the default backend:

  • If the DIALOG environment variable is set to a valid backend name, this backend is used. A valid backend name is the name of a struct in the backends module implementing the Backend trait in any case.
  • If the DISPLAY environment variable is set, the first available backend from this list is used:
  • If the Dialog backend is available, it is used.
  • Otherwise, a Stdio instance is returned.