pub struct Opener<R: Runtime> { /* private fields */ }Implementations§
Source§impl<R: Runtime> Opener<R>
impl<R: Runtime> Opener<R>
Sourcepub fn open_url(
&self,
url: impl Into<String>,
with: Option<impl Into<String>>,
) -> Result<(), Error>
pub fn open_url( &self, url: impl Into<String>, with: Option<impl Into<String>>, ) -> Result<(), Error>
Open a url with a default or specific program.
§Examples
use tauri_plugin_opener::OpenerExt;
tauri::Builder::default()
.setup(|app| {
// open the given URL on the system default browser
app.opener().open_url("https://github.com/tauri-apps/tauri", None::<&str>)?;
Ok(())
});§Platform-specific:
- Android / iOS: Always opens using default program, unless
withis provided as “inAppBrowser”.
Sourcepub fn open_path(
&self,
path: impl Into<String>,
with: Option<impl Into<String>>,
) -> Result<(), Error>
pub fn open_path( &self, path: impl Into<String>, with: Option<impl Into<String>>, ) -> Result<(), Error>
Open a path with a default or specific program.
§Examples
use tauri_plugin_opener::OpenerExt;
tauri::Builder::default()
.setup(|app| {
// open the given path on the system default explorer
app.opener().open_path("/path/to/file", None::<&str>)?;
Ok(())
});§Platform-specific:
- Android / iOS: Always opens using default program.
pub fn reveal_item_in_dir<P: AsRef<Path>>(&self, p: P) -> Result<(), Error>
Auto Trait Implementations§
impl<R> Freeze for Opener<R>
impl<R> RefUnwindSafe for Opener<R>
impl<R> Send for Opener<R>
impl<R> Sync for Opener<R>
impl<R> Unpin for Opener<R>
impl<R> UnwindSafe for Opener<R>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more