native_dialog/dialog/
mod.rs

1pub mod file;
2pub use file::*;
3
4pub mod filter;
5pub use filter::*;
6
7pub mod message;
8pub use message::*;
9
10pub trait Dialog {
11    type Output;
12}
13
14macro_rules! dialog_delegate {
15    () => {
16        pub fn show(self) -> $crate::Result<<Self as $crate::dialog::Dialog>::Output> {
17            $crate::dialog::DialogImpl::show(self)
18        }
19
20        #[cfg(feature = "async")]
21        pub async fn spawn(self) -> $crate::Result<<Self as $crate::dialog::Dialog>::Output> {
22            $crate::dialog::DialogImpl::spawn(self).await
23        }
24    };
25}
26
27use dialog_delegate;
28
29pub trait DialogImpl: Dialog {
30    fn show(self) -> crate::Result<Self::Output>;
31
32    #[cfg(feature = "async")]
33    fn spawn(self) -> impl std::future::Future<Output = crate::Result<Self::Output>> + Send;
34}
35
36#[cfg(target_os = "macos")]
37mod mac;
38
39#[cfg(all(
40    unix,
41    not(target_os = "macos"),
42    not(target_os = "ios"),
43    not(target_os = "android")
44))]
45mod gnu;
46
47#[cfg(target_os = "windows")]
48mod win;