native_dialog/
lib.rs

1#![doc = include_str!("../README.md")]
2
3use std::ffi::OsString;
4
5use thiserror::Error;
6
7pub(crate) mod builder;
8pub(crate) mod dialog;
9pub(crate) mod ffi;
10pub(crate) mod utils;
11
12pub use builder::*;
13
14pub type Result<T = ()> = std::result::Result<T, Error>;
15
16#[derive(Error, Debug)]
17pub enum Error {
18    #[error("system error or I/O failure")]
19    Io(#[from] std::io::Error),
20
21    #[error("invalid utf-8 string")]
22    Utf8(#[from] std::string::FromUtf8Error),
23
24    #[error("cannot find implementation (kdialog/zenity)")]
25    MissingDep,
26
27    #[error("subprocess killed by signal")]
28    Killed(OsString),
29
30    #[error("other errors reported by implementation")]
31    Other(String),
32}