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