mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-02-06 15:56:51 +00:00
fix(docs): set the --cfg docsrs arg for docs.rs build (#8123)
This commit is contained in:
parent
74d2464d0e
commit
0601d5dddb
2
.github/CONTRIBUTING.md
vendored
2
.github/CONTRIBUTING.md
vendored
@ -78,7 +78,7 @@ The code for Tauri Core is located in `[Tauri repo root]/core/tauri`, and the Ru
|
||||
You can build the Rust documentation locally running the following script:
|
||||
|
||||
```bash
|
||||
$ RUSTDOCFLAGS="--cfg doc_cfg" cargo +nightly doc --all-features --open
|
||||
$ RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features --open
|
||||
```
|
||||
|
||||
### Developing the JS API
|
||||
|
||||
@ -14,7 +14,16 @@ rust-version = { workspace = true }
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = [ "--cfg", "doc_cfg" ]
|
||||
default-target = "x86_64-unknown-linux-gnu"
|
||||
targets = [
|
||||
"x86_64-pc-windows-msvc",
|
||||
"x86_64-unknown-linux-gnu",
|
||||
"x86_64-apple-darwin",
|
||||
"x86_64-linux-android",
|
||||
"x86_64-apple-ios"
|
||||
]
|
||||
rustc-args = [ "--cfg", "docsrs" ]
|
||||
rustdoc-args = [ "--cfg", "docsrs" ]
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1"
|
||||
|
||||
@ -14,7 +14,7 @@ use tauri_utils::config::{AppUrl, WindowUrl};
|
||||
|
||||
// TODO docs
|
||||
/// A builder for generating a Tauri application context during compile time.
|
||||
#[cfg_attr(doc_cfg, doc(cfg(feature = "codegen")))]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "codegen")))]
|
||||
#[derive(Debug)]
|
||||
pub struct CodegenContext {
|
||||
dev: bool,
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
html_logo_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png",
|
||||
html_favicon_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png"
|
||||
)]
|
||||
#![cfg_attr(doc_cfg, feature(doc_cfg))]
|
||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||
|
||||
use anyhow::Context;
|
||||
pub use anyhow::Result;
|
||||
@ -37,7 +37,7 @@ pub mod mobile;
|
||||
mod static_vcruntime;
|
||||
|
||||
#[cfg(feature = "codegen")]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(feature = "codegen")))]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "codegen")))]
|
||||
pub use codegen::context::CodegenContext;
|
||||
|
||||
fn copy_file(from: impl AsRef<Path>, to: impl AsRef<Path>) -> Result<()> {
|
||||
|
||||
@ -13,7 +13,7 @@ edition = { workspace = true }
|
||||
rust-version = { workspace = true }
|
||||
|
||||
[dependencies]
|
||||
wry = { version = "0.34.1", default-features = false, features = [ "tao", "file-drop", "protocol" ] }
|
||||
wry = { version = "0.34.2", default-features = false, features = [ "tao", "file-drop", "protocol" ] }
|
||||
tauri-runtime = { version = "1.0.0-alpha.3", path = "../tauri-runtime" }
|
||||
tauri-utils = { version = "2.0.0-alpha.9", path = "../tauri-utils" }
|
||||
raw-window-handle = "0.5"
|
||||
|
||||
@ -14,7 +14,8 @@ rust-version = { workspace = true }
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
all-features = true
|
||||
rustdoc-args = [ "--cfg", "doc_cfg" ]
|
||||
rustc-args = [ "--cfg", "docsrs" ]
|
||||
rustdoc-args = [ "--cfg", "docsrs" ]
|
||||
default-target = "x86_64-unknown-linux-gnu"
|
||||
targets = [
|
||||
"x86_64-pc-windows-msvc",
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
html_logo_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png",
|
||||
html_favicon_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png"
|
||||
)]
|
||||
#![cfg_attr(doc_cfg, feature(doc_cfg))]
|
||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||
|
||||
use raw_window_handle::RawDisplayHandle;
|
||||
use serde::Deserialize;
|
||||
@ -176,7 +176,7 @@ pub struct RunIteration {
|
||||
|
||||
/// Application's activation policy. Corresponds to NSApplicationActivationPolicy.
|
||||
#[cfg(target_os = "macos")]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(target_os = "macos")))]
|
||||
#[cfg_attr(docsrs, doc(cfg(target_os = "macos")))]
|
||||
#[non_exhaustive]
|
||||
pub enum ActivationPolicy {
|
||||
/// Corresponds to NSApplicationActivationPolicyRegular.
|
||||
@ -211,12 +211,12 @@ pub trait RuntimeHandle<T: UserEvent>: Debug + Clone + Send + Sync + Sized + 'st
|
||||
|
||||
/// Shows the application, but does not automatically focus it.
|
||||
#[cfg(target_os = "macos")]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(target_os = "macos")))]
|
||||
#[cfg_attr(docsrs, doc(cfg(target_os = "macos")))]
|
||||
fn show(&self) -> Result<()>;
|
||||
|
||||
/// Hides the application.
|
||||
#[cfg(target_os = "macos")]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(target_os = "macos")))]
|
||||
#[cfg_attr(docsrs, doc(cfg(target_os = "macos")))]
|
||||
fn hide(&self) -> Result<()>;
|
||||
|
||||
/// Finds an Android class in the project scope.
|
||||
@ -261,7 +261,7 @@ pub trait Runtime<T: UserEvent>: Debug + Sized + 'static {
|
||||
|
||||
/// Creates a new webview runtime on any thread.
|
||||
#[cfg(any(windows, target_os = "linux"))]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(any(windows, target_os = "linux"))))]
|
||||
#[cfg_attr(docsrs, doc(cfg(any(windows, target_os = "linux"))))]
|
||||
fn new_any_thread(args: RuntimeInitArgs) -> Result<Self>;
|
||||
|
||||
/// Creates an `EventLoopProxy` that can be used to dispatch user events to the main event loop.
|
||||
@ -282,17 +282,17 @@ pub trait Runtime<T: UserEvent>: Debug + Sized + 'static {
|
||||
|
||||
/// Sets the activation policy for the application. It is set to `NSApplicationActivationPolicyRegular` by default.
|
||||
#[cfg(target_os = "macos")]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(target_os = "macos")))]
|
||||
#[cfg_attr(docsrs, doc(cfg(target_os = "macos")))]
|
||||
fn set_activation_policy(&mut self, activation_policy: ActivationPolicy);
|
||||
|
||||
/// Shows the application, but does not automatically focus it.
|
||||
#[cfg(target_os = "macos")]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(target_os = "macos")))]
|
||||
#[cfg_attr(docsrs, doc(cfg(target_os = "macos")))]
|
||||
fn show(&self);
|
||||
|
||||
/// Hides the application.
|
||||
#[cfg(target_os = "macos")]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(target_os = "macos")))]
|
||||
#[cfg_attr(docsrs, doc(cfg(target_os = "macos")))]
|
||||
fn hide(&self);
|
||||
|
||||
/// Change the device event filter mode.
|
||||
|
||||
@ -230,7 +230,7 @@ pub trait WindowBuilder: WindowBuilderBase {
|
||||
/// with alpha values different than `1.0` will produce a transparent window.
|
||||
#[cfg(any(not(target_os = "macos"), feature = "macos-private-api"))]
|
||||
#[cfg_attr(
|
||||
doc_cfg,
|
||||
docsrs,
|
||||
doc(cfg(any(not(target_os = "macos"), feature = "macos-private-api")))
|
||||
)]
|
||||
#[must_use]
|
||||
|
||||
@ -24,7 +24,8 @@ features = [
|
||||
"protocol-asset",
|
||||
"test",
|
||||
]
|
||||
rustdoc-args = [ "--cfg", "doc_cfg" ]
|
||||
rustc-args = [ "--cfg", "docsrs" ]
|
||||
rustdoc-args = [ "--cfg", "docsrs" ]
|
||||
default-target = "x86_64-unknown-linux-gnu"
|
||||
targets = [
|
||||
"x86_64-pc-windows-msvc",
|
||||
|
||||
@ -193,18 +193,18 @@ pub enum RunEvent {
|
||||
MainEventsCleared,
|
||||
/// Emitted when the user wants to open the specified resource with the app.
|
||||
#[cfg(any(target_os = "macos", target_os = "ios"))]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(any(target_os = "macos", feature = "ios"))))]
|
||||
#[cfg_attr(docsrs, doc(cfg(any(target_os = "macos", feature = "ios"))))]
|
||||
Opened {
|
||||
/// The URL of the resources that is being open.
|
||||
urls: Vec<url::Url>,
|
||||
},
|
||||
/// An event from a menu item, could be on the window menu bar, application menu bar (on macOS) or tray icon menu.
|
||||
#[cfg(desktop)]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(desktop)))]
|
||||
#[cfg_attr(docsrs, doc(cfg(desktop)))]
|
||||
MenuEvent(crate::menu::MenuEvent),
|
||||
/// An event from a tray icon.
|
||||
#[cfg(all(desktop, feature = "tray-icon"))]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
||||
#[cfg_attr(docsrs, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
||||
TrayIconEvent(crate::tray::TrayIconEvent),
|
||||
}
|
||||
|
||||
@ -506,7 +506,7 @@ macro_rules! shared_app_impl {
|
||||
|
||||
/// Registers a global tray icon menu event listener.
|
||||
#[cfg(all(desktop, feature = "tray-icon"))]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
||||
#[cfg_attr(docsrs, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
||||
pub fn on_tray_icon_event<F: Fn(&AppHandle<R>, TrayIconEvent) + Send + Sync + 'static>(
|
||||
&self,
|
||||
handler: F,
|
||||
@ -523,7 +523,7 @@ macro_rules! shared_app_impl {
|
||||
/// Gets the first tray icon registered,
|
||||
/// usually the one configured in the Tauri configuration file.
|
||||
#[cfg(all(desktop, feature = "tray-icon"))]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
||||
#[cfg_attr(docsrs, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
||||
pub fn tray(&self) -> Option<TrayIcon<R>> {
|
||||
self
|
||||
.manager
|
||||
@ -540,7 +540,7 @@ macro_rules! shared_app_impl {
|
||||
///
|
||||
/// Note that dropping the returned icon, will cause the tray icon to disappear.
|
||||
#[cfg(all(desktop, feature = "tray-icon"))]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
||||
#[cfg_attr(docsrs, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
||||
pub fn remove_tray(&self) -> Option<TrayIcon<R>> {
|
||||
let mut tray_icons = self.manager.inner.tray_icons.lock().unwrap();
|
||||
if !tray_icons.is_empty() {
|
||||
@ -551,7 +551,7 @@ macro_rules! shared_app_impl {
|
||||
|
||||
/// Gets a tray icon using the provided id.
|
||||
#[cfg(all(desktop, feature = "tray-icon"))]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
||||
#[cfg_attr(docsrs, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
||||
pub fn tray_by_id<'a, I>(&self, id: &'a I) -> Option<TrayIcon<R>>
|
||||
where
|
||||
I: ?Sized,
|
||||
@ -572,7 +572,7 @@ macro_rules! shared_app_impl {
|
||||
///
|
||||
/// Note that dropping the returned icon, will cause the tray icon to disappear.
|
||||
#[cfg(all(desktop, feature = "tray-icon"))]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
||||
#[cfg_attr(docsrs, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
||||
pub fn remove_tray_by_id<'a, I>(&self, id: &'a I) -> Option<TrayIcon<R>>
|
||||
where
|
||||
I: ?Sized,
|
||||
@ -824,7 +824,7 @@ impl<R: Runtime> App<R> {
|
||||
/// app.run(|_app_handle, _event| {});
|
||||
/// ```
|
||||
#[cfg(target_os = "macos")]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(target_os = "macos")))]
|
||||
#[cfg_attr(docsrs, doc(cfg(target_os = "macos")))]
|
||||
pub fn set_activation_policy(&mut self, activation_policy: ActivationPolicy) {
|
||||
self
|
||||
.runtime
|
||||
@ -1046,7 +1046,7 @@ impl<R: Runtime> Builder<R> {
|
||||
///
|
||||
/// - **macOS:** on macOS the application *must* be executed on the main thread, so this function is not exposed.
|
||||
#[cfg(any(windows, target_os = "linux"))]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(any(windows, target_os = "linux"))))]
|
||||
#[cfg_attr(docsrs, doc(cfg(any(windows, target_os = "linux"))))]
|
||||
#[must_use]
|
||||
pub fn any_thread(mut self) -> Self {
|
||||
self.runtime_any_thread = true;
|
||||
@ -1176,7 +1176,7 @@ impl<R: Runtime> Builder<R> {
|
||||
/// refers to a different `T`.
|
||||
///
|
||||
/// Managed state can be retrieved by any command handler via the
|
||||
/// [`State`](crate::State) guard. In particular, if a value of type `T`
|
||||
/// [`State`] guard. In particular, if a value of type `T`
|
||||
/// is managed by Tauri, adding `State<T>` to the list of arguments in a
|
||||
/// command handler instructs Tauri to retrieve the managed value.
|
||||
/// Additionally, [`state`](crate::Manager#method.state) can be used to retrieve the value manually.
|
||||
@ -1859,7 +1859,7 @@ fn on_event_loop_event<R: Runtime, F: FnMut(&AppHandle<R>, RunEvent) + 'static>(
|
||||
|
||||
/// Make `Wry` the default `Runtime` for `Builder`
|
||||
#[cfg(feature = "wry")]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(feature = "wry")))]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "wry")))]
|
||||
impl Default for Builder<crate::Wry> {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
|
||||
@ -100,12 +100,12 @@ pub enum Error {
|
||||
/// Tray icon error.
|
||||
#[error("tray icon error: {0}")]
|
||||
#[cfg(all(desktop, feature = "tray-icon"))]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
||||
#[cfg_attr(docsrs, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
||||
Tray(#[from] tray_icon::Error),
|
||||
/// Bad tray icon error.
|
||||
#[error(transparent)]
|
||||
#[cfg(all(desktop, feature = "tray-icon"))]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
||||
#[cfg_attr(docsrs, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
||||
BadTrayIcon(#[from] tray_icon::BadIcon),
|
||||
/// Path does not have a parent.
|
||||
#[error("path does not have a parent")]
|
||||
|
||||
@ -48,7 +48,7 @@
|
||||
html_favicon_url = "https://github.com/tauri-apps/tauri/raw/dev/app-icon.png"
|
||||
)]
|
||||
#![warn(missing_docs, rust_2018_idioms)]
|
||||
#![cfg_attr(doc_cfg, feature(doc_cfg))]
|
||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||
|
||||
/// Setups the binding that initializes an iOS plugin.
|
||||
#[cfg(target_os = "ios")]
|
||||
@ -97,7 +97,7 @@ pub mod scope;
|
||||
mod state;
|
||||
|
||||
#[cfg(all(desktop, feature = "tray-icon"))]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
||||
#[cfg_attr(docsrs, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
||||
pub mod tray;
|
||||
pub use tauri_utils as utils;
|
||||
|
||||
@ -105,11 +105,11 @@ pub use http;
|
||||
|
||||
/// A Tauri [`Runtime`] wrapper around wry.
|
||||
#[cfg(feature = "wry")]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(feature = "wry")))]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "wry")))]
|
||||
pub type Wry = tauri_runtime_wry::Wry<EventLoopMessage>;
|
||||
|
||||
#[cfg(all(feature = "wry", target_os = "android"))]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(all(feature = "wry", target_os = "android"))))]
|
||||
#[cfg_attr(docsrs, doc(cfg(all(feature = "wry", target_os = "android"))))]
|
||||
#[doc(hidden)]
|
||||
#[macro_export]
|
||||
macro_rules! android_binding {
|
||||
@ -168,11 +168,11 @@ use std::{
|
||||
};
|
||||
|
||||
#[cfg(feature = "wry")]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(feature = "wry")))]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "wry")))]
|
||||
pub use tauri_runtime_wry::webview_version;
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(target_os = "macos")))]
|
||||
#[cfg_attr(docsrs, doc(cfg(target_os = "macos")))]
|
||||
pub use runtime::ActivationPolicy;
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
@ -251,7 +251,7 @@ pub enum EventLoopMessage {
|
||||
MenuEvent(menu::MenuEvent),
|
||||
/// An event from a menu item, could be on the window menu bar, application menu bar (on macOS) or tray icon menu.
|
||||
#[cfg(all(desktop, feature = "tray-icon"))]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
||||
#[cfg_attr(docsrs, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
||||
TrayIconEvent(tray::TrayIconEvent),
|
||||
}
|
||||
|
||||
@ -302,11 +302,11 @@ pub use pattern::Pattern;
|
||||
pub enum Icon {
|
||||
/// Icon from file path.
|
||||
#[cfg(any(feature = "icon-ico", feature = "icon-png"))]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(any(feature = "icon-ico", feature = "icon-png"))))]
|
||||
#[cfg_attr(docsrs, doc(cfg(any(feature = "icon-ico", feature = "icon-png"))))]
|
||||
File(std::path::PathBuf),
|
||||
/// Icon from raw RGBA bytes. Width and height is parsed at runtime.
|
||||
#[cfg(any(feature = "icon-ico", feature = "icon-png"))]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(any(feature = "icon-ico", feature = "icon-png"))))]
|
||||
#[cfg_attr(docsrs, doc(cfg(any(feature = "icon-ico", feature = "icon-png"))))]
|
||||
Raw(Vec<u8>),
|
||||
/// Icon from raw RGBA bytes.
|
||||
Rgba {
|
||||
@ -454,7 +454,7 @@ impl<A: Assets> Context<A> {
|
||||
|
||||
/// The icon to use on the system tray UI.
|
||||
#[cfg(all(desktop, feature = "tray-icon"))]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
||||
#[cfg_attr(docsrs, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
||||
#[inline(always)]
|
||||
pub fn tray_icon(&self) -> Option<&Icon> {
|
||||
self.tray_icon.as_ref()
|
||||
@ -462,7 +462,7 @@ impl<A: Assets> Context<A> {
|
||||
|
||||
/// A mutable reference to the icon to use on the tray icon.
|
||||
#[cfg(all(desktop, feature = "tray-icon"))]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
||||
#[cfg_attr(docsrs, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
||||
#[inline(always)]
|
||||
pub fn tray_icon_mut(&mut self) -> &mut Option<Icon> {
|
||||
&mut self.tray_icon
|
||||
@ -513,7 +513,7 @@ impl<A: Assets> Context<A> {
|
||||
|
||||
/// Sets the app tray icon.
|
||||
#[cfg(all(desktop, feature = "tray-icon"))]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
||||
#[cfg_attr(docsrs, doc(cfg(all(desktop, feature = "tray-icon"))))]
|
||||
#[inline(always)]
|
||||
pub fn set_tray_icon(&mut self, icon: Icon) {
|
||||
self.tray_icon.replace(icon);
|
||||
@ -859,7 +859,7 @@ pub(crate) mod sealed {
|
||||
}
|
||||
|
||||
#[cfg(any(test, feature = "test"))]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(feature = "test")))]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "test")))]
|
||||
pub mod test;
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
@ -272,7 +272,7 @@ impl WindowBuilder for MockWindowBuilder {
|
||||
|
||||
#[cfg(any(not(target_os = "macos"), feature = "macos-private-api"))]
|
||||
#[cfg_attr(
|
||||
doc_cfg,
|
||||
docsrs,
|
||||
doc(cfg(any(not(target_os = "macos"), feature = "macos-private-api")))
|
||||
)]
|
||||
fn transparent(self, transparent: bool) -> Self {
|
||||
@ -777,15 +777,15 @@ impl<T: UserEvent> Runtime<T> for MockRuntime {
|
||||
}
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(target_os = "macos")))]
|
||||
#[cfg_attr(docsrs, doc(cfg(target_os = "macos")))]
|
||||
fn set_activation_policy(&mut self, activation_policy: tauri_runtime::ActivationPolicy) {}
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(target_os = "macos")))]
|
||||
#[cfg_attr(docsrs, doc(cfg(target_os = "macos")))]
|
||||
fn show(&self) {}
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(target_os = "macos")))]
|
||||
#[cfg_attr(docsrs, doc(cfg(target_os = "macos")))]
|
||||
fn hide(&self) {}
|
||||
|
||||
fn set_device_event_filter(&mut self, filter: DeviceEventFilter) {}
|
||||
|
||||
@ -669,7 +669,7 @@ impl<'a, R: Runtime> WindowBuilder<'a, R> {
|
||||
/// with alpha values different than `1.0` will produce a transparent window.
|
||||
#[cfg(any(not(target_os = "macos"), feature = "macos-private-api"))]
|
||||
#[cfg_attr(
|
||||
doc_cfg,
|
||||
docsrs,
|
||||
doc(cfg(any(not(target_os = "macos"), feature = "macos-private-api")))
|
||||
)]
|
||||
#[must_use]
|
||||
@ -1079,7 +1079,7 @@ impl<'de, R: Runtime> CommandArg<'de, R> for Window<R> {
|
||||
|
||||
/// The platform webview handle. Accessed with [`Window#method.with_webview`];
|
||||
#[cfg(feature = "wry")]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(feature = "wry")))]
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "wry")))]
|
||||
pub struct PlatformWebview(tauri_runtime_wry::Webview);
|
||||
|
||||
#[cfg(feature = "wry")]
|
||||
@ -1093,7 +1093,7 @@ impl PlatformWebview {
|
||||
target_os = "openbsd"
|
||||
))]
|
||||
#[cfg_attr(
|
||||
doc_cfg,
|
||||
docsrs,
|
||||
doc(cfg(any(
|
||||
target_os = "linux",
|
||||
target_os = "dragonfly",
|
||||
@ -1108,7 +1108,7 @@ impl PlatformWebview {
|
||||
|
||||
/// Returns the WebView2 controller.
|
||||
#[cfg(windows)]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(windows)))]
|
||||
#[cfg_attr(docsrs, doc(cfg(windows)))]
|
||||
pub fn controller(
|
||||
&self,
|
||||
) -> webview2_com::Microsoft::Web::WebView2::Win32::ICoreWebView2Controller {
|
||||
@ -1119,7 +1119,7 @@ impl PlatformWebview {
|
||||
///
|
||||
/// [WKWebView]: https://developer.apple.com/documentation/webkit/wkwebview
|
||||
#[cfg(any(target_os = "macos", target_os = "ios"))]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(any(target_os = "macos", target_os = "ios"))))]
|
||||
#[cfg_attr(docsrs, doc(cfg(any(target_os = "macos", target_os = "ios"))))]
|
||||
pub fn inner(&self) -> cocoa::base::id {
|
||||
self.0.webview
|
||||
}
|
||||
@ -1128,7 +1128,7 @@ impl PlatformWebview {
|
||||
///
|
||||
/// [controller]: https://developer.apple.com/documentation/webkit/wkusercontentcontroller
|
||||
#[cfg(any(target_os = "macos", target_os = "ios"))]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(any(target_os = "macos", target_os = "ios"))))]
|
||||
#[cfg_attr(docsrs, doc(cfg(any(target_os = "macos", target_os = "ios"))))]
|
||||
pub fn controller(&self) -> cocoa::base::id {
|
||||
self.0.manager
|
||||
}
|
||||
@ -1137,7 +1137,7 @@ impl PlatformWebview {
|
||||
///
|
||||
/// [NSWindow]: https://developer.apple.com/documentation/appkit/nswindow
|
||||
#[cfg(target_os = "macos")]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(target_os = "macos")))]
|
||||
#[cfg_attr(docsrs, doc(cfg(target_os = "macos")))]
|
||||
pub fn ns_window(&self) -> cocoa::base::id {
|
||||
self.0.ns_window
|
||||
}
|
||||
@ -1146,7 +1146,7 @@ impl PlatformWebview {
|
||||
///
|
||||
/// [UIViewController]: https://developer.apple.com/documentation/uikit/uiviewcontroller
|
||||
#[cfg(target_os = "ios")]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(target_os = "ios")))]
|
||||
#[cfg_attr(docsrs, doc(cfg(target_os = "ios")))]
|
||||
pub fn view_controller(&self) -> cocoa::base::id {
|
||||
self.0.view_controller
|
||||
}
|
||||
@ -1267,7 +1267,7 @@ impl<R: Runtime> Window<R> {
|
||||
/// }
|
||||
/// ```
|
||||
#[cfg(feature = "wry")]
|
||||
#[cfg_attr(doc_cfg, doc(feature = "wry"))]
|
||||
#[cfg_attr(docsrs, doc(feature = "wry"))]
|
||||
pub fn with_webview<F: FnOnce(PlatformWebview) + Send + 'static>(
|
||||
&self,
|
||||
f: F,
|
||||
@ -2429,7 +2429,7 @@ impl<R: Runtime> Window<R> {
|
||||
/// });
|
||||
/// ```
|
||||
#[cfg(any(debug_assertions, feature = "devtools"))]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(any(debug_assertions, feature = "devtools"))))]
|
||||
#[cfg_attr(docsrs, doc(cfg(any(debug_assertions, feature = "devtools"))))]
|
||||
pub fn open_devtools(&self) {
|
||||
self.window.dispatcher.open_devtools();
|
||||
}
|
||||
@ -2462,7 +2462,7 @@ impl<R: Runtime> Window<R> {
|
||||
/// });
|
||||
/// ```
|
||||
#[cfg(any(debug_assertions, feature = "devtools"))]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(any(debug_assertions, feature = "devtools"))))]
|
||||
#[cfg_attr(docsrs, doc(cfg(any(debug_assertions, feature = "devtools"))))]
|
||||
pub fn close_devtools(&self) {
|
||||
self.window.dispatcher.close_devtools();
|
||||
}
|
||||
@ -2493,7 +2493,7 @@ impl<R: Runtime> Window<R> {
|
||||
/// });
|
||||
/// ```
|
||||
#[cfg(any(debug_assertions, feature = "devtools"))]
|
||||
#[cfg_attr(doc_cfg, doc(cfg(any(debug_assertions, feature = "devtools"))))]
|
||||
#[cfg_attr(docsrs, doc(cfg(any(debug_assertions, feature = "devtools"))))]
|
||||
pub fn is_devtools_open(&self) -> bool {
|
||||
self
|
||||
.window
|
||||
|
||||
4
examples/api/src-tauri/Cargo.lock
generated
4
examples/api/src-tauri/Cargo.lock
generated
@ -4503,9 +4503,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wry"
|
||||
version = "0.34.1"
|
||||
version = "0.34.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "91ad4935cc1cbd02e7cfcf41baa44e35f134c108389be3949d8b369eb69e741b"
|
||||
checksum = "3f1e29660f22d8eec141f41f59b7fef231e4113c370c89b90ae3a0db8dec1927"
|
||||
dependencies = [
|
||||
"base64",
|
||||
"block",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user