tauri_api/
lib.rs

1//! The Tauri alpha API interface. Deprecated after the Tauri beta release, it's now part of the `tauri` crate.
2#![warn(missing_docs, rust_2018_idioms)]
3#![cfg_attr(
4  all(not(debug_assertions), target_os = "windows"),
5  windows_subsystem = "windows"
6)]
7
8/// The Command API module allows you to manage child processes.
9pub mod command;
10/// The Config module allows you to read the configuration from `tauri.conf.json`.
11pub mod config;
12/// The Dialog API module allows you to show messages and prompt for file paths.
13pub mod dialog;
14/// The Dir module is a helper for file system directory management.
15pub mod dir;
16/// The File API module contains helpers to perform file operations.
17pub mod file;
18/// The HTTP request API.
19pub mod http;
20/// The file system path operations API.
21pub mod path;
22/// The RPC module includes utilities to send messages to the JS layer of the webview.
23pub mod rpc;
24/// TCP ports access API.
25pub mod tcp;
26/// The semver API.
27pub mod version;
28
29/// The CLI args interface.
30#[cfg(feature = "cli")]
31pub mod cli;
32#[cfg(feature = "cli")]
33#[macro_use]
34extern crate clap;
35
36/// The desktop notifications API module.
37#[cfg(feature = "notification")]
38pub mod notification;
39
40pub use tauri_utils::*;
41
42/// Alias for a Result with error type anyhow::Error.
43pub use anyhow::Result;
44use thiserror::Error;
45
46/// The error types.
47#[derive(Error, Debug)]
48pub enum Error {
49  /// The extract archive error.
50  #[error("Extract Error:{0}")]
51  Extract(String),
52  /// The Command (spawn process) error.
53  #[error("Command Error:{0}")]
54  Command(String),
55  /// The file operation error.
56  #[error("File Error:{0}")]
57  File(String),
58  /// The path operation error.
59  #[error("Path Error:{0}")]
60  Path(String),
61  /// The dialog error.
62  #[error("Dialog Error:{0}")]
63  Dialog(String),
64  /// The network error.
65  #[error("Network Error:{0}")]
66  Network(attohttpc::StatusCode),
67}