tauri-plugin-devtools-app 2.1.3

Connect with the Devtools for Tauri application
use tauri::Runtime;

/// Same signature as the desktop plugin; unused on mobile (no-op plugin).
pub fn default_custom_scheme_url(auth_protocol: &str) -> String {
    if cfg!(windows) {
        format!("http://{}.localhost", auth_protocol)
    } else {
        format!("{}://localhost", auth_protocol)
    }
}

/// Builder for the no-op mobile plugin (same API as desktop; [`custom_scheme_url`](Builder::custom_scheme_url) is ignored).
pub struct Builder;

impl Builder {
    #[must_use]
    pub fn new() -> Self {
        Self
    }

    #[must_use]
    pub fn custom_scheme_url<F>(self, _f: F) -> Self
    where
        F: Fn(&str) -> String + Send + Sync + 'static,
    {
        self
    }

    /// no-op plugin (same as [`init`]).
    #[must_use]
    pub fn build<R: Runtime>(self) -> tauri::plugin::TauriPlugin<R> {
        tauri::plugin::Builder::new("devtools-app").build()
    }
}

/// no-op
#[must_use]
pub fn init<R: Runtime>() -> tauri::plugin::TauriPlugin<R> {
    Builder::new().build()
}