native_dialog/
lib.rs

1#[cfg(target_os = "macos")]
2#[macro_use]
3extern crate objc;
4
5#[cfg(target_os = "macos")]
6#[macro_use]
7extern crate objc_foundation;
8
9use thiserror::Error;
10
11#[derive(Error, Debug)]
12pub enum Error {
13    #[error("system error or I/O failure")]
14    IoFailure(#[from] std::io::Error),
15
16    #[error("the implementation returns malformed strings")]
17    InvalidString(#[from] std::string::FromUtf8Error),
18
19    #[error("failed to parse the string returned from implementation")]
20    UnexpectedOutput(&'static str),
21
22    #[error("cannot find any dialog implementation (kdialog/zenity)")]
23    NoImplementation,
24
25    #[error("the implementation reports error")]
26    ImplementationError(String),
27}
28
29pub type Result<T> = std::result::Result<T, Error>;
30
31pub(crate) mod dialog;
32pub(crate) mod dialog_impl;
33pub(crate) mod util;
34
35mod message;
36pub use message::*;
37
38mod file;
39pub use file::*;