@@ -38,6 +38,19 @@ pub struct Opener<R: Runtime> {
38
38
impl < R : Runtime > Opener < R > {
39
39
/// Open a url with a default or specific program.
40
40
///
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
+ ///
41
54
/// ## Platform-specific:
42
55
///
43
56
/// - **Android / iOS**: Always opens using default program.
@@ -48,6 +61,19 @@ impl<R: Runtime> Opener<R> {
48
61
49
62
/// Open a url with a default or specific program.
50
63
///
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
+ ///
51
77
/// ## Platform-specific:
52
78
///
53
79
/// - **Android / iOS**: Always opens using default program.
@@ -60,6 +86,19 @@ impl<R: Runtime> Opener<R> {
60
86
61
87
/// Open a path with a default or specific program.
62
88
///
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
+ ///
63
102
/// ## Platform-specific:
64
103
///
65
104
/// - **Android / iOS**: Always opens using default program.
@@ -74,6 +113,19 @@ impl<R: Runtime> Opener<R> {
74
113
75
114
/// Open a path with a default or specific program.
76
115
///
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
+ ///
77
129
/// ## Platform-specific:
78
130
///
79
131
/// - **Android / iOS**: Always opens using default program.
@@ -98,7 +150,7 @@ pub trait OpenerExt<R: Runtime> {
98
150
fn opener ( & self ) -> & Opener < R > ;
99
151
}
100
152
101
- impl < R : Runtime , T : Manager < R > > crate :: OpenerExt < R > for T {
153
+ impl < R : Runtime , T : Manager < R > > OpenerExt < R > for T {
102
154
fn opener ( & self ) -> & Opener < R > {
103
155
self . state :: < Opener < R > > ( ) . inner ( )
104
156
}
0 commit comments