[][src]Function dialog::default_backend

pub fn default_backend() -> Box<dyn Backend>

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 following resolution algorithm is used:
    • If the XDG_CURRENT_DESKTOP environment variable is set to KDE, KDialog is used.
    • Otherwise, the first available backend from this list is used:
  • If the Dialog backend is available, it is used.
  • Otherwise, a Stdio instance is returned.