mod.rs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // Copyright 2019-2023 Tauri Programme within The Commons Conservancy
  2. // SPDX-License-Identifier: Apache-2.0
  3. // SPDX-License-Identifier: MIT
  4. //! The Tauri API interface.
  5. #[cfg(all(desktop, feature = "dialog"))]
  6. #[cfg_attr(doc_cfg, doc(cfg(all(desktop, feature = "dialog"))))]
  7. pub mod dialog;
  8. pub mod dir;
  9. pub mod file;
  10. #[cfg(feature = "http-api")]
  11. #[cfg_attr(doc_cfg, doc(cfg(feature = "http-api")))]
  12. pub mod http;
  13. pub mod ipc;
  14. pub mod path;
  15. pub mod process;
  16. #[cfg(feature = "shell-open-api")]
  17. #[cfg_attr(doc_cfg, doc(cfg(feature = "shell-open-api")))]
  18. pub mod shell;
  19. pub mod version;
  20. #[cfg(feature = "cli")]
  21. #[cfg_attr(doc_cfg, doc(cfg(feature = "cli")))]
  22. pub mod cli;
  23. #[cfg(feature = "cli")]
  24. #[cfg_attr(doc_cfg, doc(cfg(feature = "cli")))]
  25. pub use clap;
  26. #[cfg(all(desktop, feature = "notification"))]
  27. #[cfg_attr(doc_cfg, doc(cfg(all(desktop, feature = "notification"))))]
  28. pub mod notification;
  29. mod error;
  30. /// The error type of Tauri API module.
  31. pub use error::Error;
  32. /// The result type of Tauri API module.
  33. pub type Result<T> = std::result::Result<T, Error>;
  34. // Not public API
  35. #[doc(hidden)]
  36. pub mod private {
  37. pub use once_cell::sync::OnceCell;
  38. pub trait AsTauriContext {
  39. fn config() -> &'static crate::Config;
  40. fn assets() -> &'static crate::utils::assets::EmbeddedAssets;
  41. fn default_window_icon() -> Option<&'static [u8]>;
  42. fn package_info() -> crate::PackageInfo;
  43. }
  44. }