@@ -38,6 +38,19 @@ pub struct Opener<R: Runtime> {
3838impl < R : Runtime > Opener < R > {
3939 /// Open a url with a default or specific program.
4040 ///
41+ /// # Examples
42+ ///
43+ /// ```rust,no_run
44+ /// use tauri_plugin_opener::OpenerExt;
45+ ///
46+ /// tauri::Builder::default()
47+ /// .setup(|app| {
48+ /// // open the given URL on the system default browser
49+ /// app.opener().open_url("https://github.com/tauri-apps/tauri", None::<&str>)?;
50+ /// Ok(())
51+ /// });
52+ /// ```
53+ ///
4154 /// ## Platform-specific:
4255 ///
4356 /// - **Android / iOS**: Always opens using default program.
@@ -48,6 +61,19 @@ impl<R: Runtime> Opener<R> {
4861
4962 /// Open a url with a default or specific program.
5063 ///
64+ /// # Examples
65+ ///
66+ /// ```rust,no_run
67+ /// use tauri_plugin_opener::OpenerExt;
68+ ///
69+ /// tauri::Builder::default()
70+ /// .setup(|app| {
71+ /// // open the given URL on the system default browser
72+ /// app.opener().open_url("https://github.com/tauri-apps/tauri", None::<&str>)?;
73+ /// Ok(())
74+ /// });
75+ /// ```
76+ ///
5177 /// ## Platform-specific:
5278 ///
5379 /// - **Android / iOS**: Always opens using default program.
@@ -60,6 +86,19 @@ impl<R: Runtime> Opener<R> {
6086
6187 /// Open a path with a default or specific program.
6288 ///
89+ /// # Examples
90+ ///
91+ /// ```rust,no_run
92+ /// use tauri_plugin_opener::OpenerExt;
93+ ///
94+ /// tauri::Builder::default()
95+ /// .setup(|app| {
96+ /// // open the given path on the system default explorer
97+ /// app.opener().open_path("/path/to/file", None::<&str>)?;
98+ /// Ok(())
99+ /// });
100+ /// ```
101+ ///
63102 /// ## Platform-specific:
64103 ///
65104 /// - **Android / iOS**: Always opens using default program.
@@ -74,6 +113,19 @@ impl<R: Runtime> Opener<R> {
74113
75114 /// Open a path with a default or specific program.
76115 ///
116+ /// # Examples
117+ ///
118+ /// ```rust,no_run
119+ /// use tauri_plugin_opener::OpenerExt;
120+ ///
121+ /// tauri::Builder::default()
122+ /// .setup(|app| {
123+ /// // open the given path on the system default explorer
124+ /// app.opener().open_path("/path/to/file", None::<&str>)?;
125+ /// Ok(())
126+ /// });
127+ /// ```
128+ ///
77129 /// ## Platform-specific:
78130 ///
79131 /// - **Android / iOS**: Always opens using default program.
@@ -98,7 +150,7 @@ pub trait OpenerExt<R: Runtime> {
98150 fn opener ( & self ) -> & Opener < R > ;
99151}
100152
101- impl < R : Runtime , T : Manager < R > > crate :: OpenerExt < R > for T {
153+ impl < R : Runtime , T : Manager < R > > OpenerExt < R > for T {
102154 fn opener ( & self ) -> & Opener < R > {
103155 self . state :: < Opener < R > > ( ) . inner ( )
104156 }
0 commit comments