Skip to main content

ShellExt

Trait ShellExt 

Source
pub trait ShellExt<R: Runtime> {
    // Required method
    fn shell(&self) -> &Shell<R>;
}
Expand description

Extensions to tauri::App, tauri::AppHandle, tauri::WebviewWindow, tauri::Webview and tauri::Window to access the shell APIs.

Required Methods§

Source

fn shell(&self) -> &Shell<R>

Gets the shell APIs.

§Examples
use tauri_plugin_shell::ShellExt;

async fn run_echo<R: tauri::Runtime>(app: &tauri::AppHandle<R>) {
    let output = app.shell().command("echo").args(["hello"]).output().await.unwrap();
    println!("{}", String::from_utf8_lossy(&output.stdout));
}

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<R: Runtime, T: Manager<R>> ShellExt<R> for T