Skip to content

Commit 23b1d4e

Browse files
tauri-bottauri-bot
andauthored
chore(docs): Update Rust docs (tauri-apps#108)
Co-authored-by: tauri-bot <[email protected]>
1 parent ae919e9 commit 23b1d4e

27 files changed

+274
-49
lines changed

docs/en/api/rust/tauri/event/fn.emit.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ title: "fn.emit"
44

55
# Function [tauri](/docs/api/rust/tauri/../index.html)::​[event](/docs/api/rust/tauri/index.html)::​[emit](/docs/api/rust/tauri/)
66

7-
pub fn emit<T: 'static, S: Serialize>(
8-
    webview_handle: &Handle<T>,
7+
pub fn emit<S: Serialize>(
8+
    webview: &mut WebviewMut,
99
    event: impl AsRef<str> + Send + 'static,
1010
    payload: Option<S>
1111
) -> Result<()>

docs/en/api/rust/tauri/fn.call.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ title: "fn.call"
44

55
# Function [tauri](/docs/api/rust/tauri/index.html)::​[call](/docs/api/rust/tauri/)
66

7-
pub fn call<T: 'static>(
8-
    webview: &mut WebView<T>,
7+
pub fn call(
8+
    webview: &mut Webview,
99
    command: String,
1010
    args: Vec<String>,
1111
    callback: String,

docs/en/api/rust/tauri/fn.close_splashscreen.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ title: "fn.close_splashscreen"
44

55
# Function [tauri](/docs/api/rust/tauri/index.html)::​[close_splashscreen](/docs/api/rust/tauri/)
66

7-
pub fn close_splashscreen<T: 'static>(webview_handle: &Handle<T>) -> Result<()>
7+
pub fn close_splashscreen(webview: &mut Webview) -> Result<()>
88

99
Closes the splashscreen.

docs/en/api/rust/tauri/fn.execute_promise.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ title: "fn.execute_promise"
44

55
# Function [tauri](/docs/api/rust/tauri/index.html)::​[execute_promise](/docs/api/rust/tauri/)
66

7-
pub fn execute_promise<T: 'static, R: Serialize, F: FnOnce() -> Result<R> + Send + 'static>(
8-
    webview: &mut WebView<T>,
7+
pub fn execute_promise<R: Serialize, F: FnOnce() -> Result<R> + Send + 'static>(
8+
    webview: &mut Webview,
99
    task: F,
1010
    success_callback: String,
1111
    error_callback: String

docs/en/api/rust/tauri/fn.execute_promise_sync.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ title: "fn.execute_promise_sync"
44

55
# Function [tauri](/docs/api/rust/tauri/index.html)::​[execute_promise_sync](/docs/api/rust/tauri/)
66

7-
pub fn execute_promise_sync<T: 'static, R: Serialize, F: FnOnce() -> Result<R> + Send + 'static>(
8-
    webview: &mut WebView<T>,
7+
pub fn execute_promise_sync<R: Serialize, F: FnOnce() -> Result<R> + Send + 'static>(
8+
    webview: &mut Webview,
99
    task: F,
1010
    callback: String,
1111
    error: String
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
title: "fn.register"
3+
---
4+
5+
# Function [tauri](/docs/api/rust/tauri/../index.html)::​[plugin](/docs/api/rust/tauri/index.html)::​[register](/docs/api/rust/tauri/)
6+
7+
pub fn register(ext: impl Plugin + 'static)
8+
9+
Registers a plugin.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
title: "trait.Plugin"
3+
---
4+
5+
# Trait [tauri](/docs/api/rust/tauri/../index.html)::​[plugin](/docs/api/rust/tauri/index.html)::​[Plugin](/docs/api/rust/tauri/)
6+
7+
pub trait Plugin {
8+
fn init_script(&self) -> Option<String> { ... }
9+
10+
fn created(&self, webview: &mut Webview) { ... }
11+
12+
fn ready(&self, webview: &mut Webview) { ... }
13+
14+
fn extend_api(
15+
        &self,
16+
        webview: &mut Webview,
17+
        payload: &str
18+
    ) -> Result<bool, String> { ... }
19+
}
20+
21+
The plugin interface.
22+
23+
## Provided methods
24+
25+
### `fn init_script(&self) -> Option<String>`
26+
27+
The JS script to evaluate on init.
28+
29+
### `fn created(&self, webview: &mut Webview)`
30+
31+
Callback invoked when the webview is created.
32+
33+
### `fn ready(&self, webview: &mut Webview)`
34+
35+
Callback invoked when the webview is ready.
36+
37+
### `fn extend_api( &self, webview: &mut Webview, payload: &str ) -> Result<bool, String>`
38+
39+
Add invoke_handler API extension commands.
40+
41+
Loading content...
42+
43+
## Implementors
44+
45+
Loading content...

docs/en/api/rust/tauri/settings/struct.Settings.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ Returns the "default value" for a type. [Read more](https://doc.rust-lang.org/ni
2828

2929
#### `fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where __D: Deserializer<'de>,`
3030

31-
Deserialize this value from the given Serde deserializer. [Read more](https://docs.rs/serde/1.0.104/serde/de/trait.Deserialize.html#tymethod.deserialize)
31+
Deserialize this value from the given Serde deserializer. [Read more](https://docs.rs/serde/1.0.114/serde/de/trait.Deserialize.html#tymethod.deserialize)
3232

3333
### `impl Serialize for Settings`
3434

3535
#### `fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where __S: Serializer,`
3636

37-
Serialize this value into the given Serde serializer. [Read more](https://docs.rs/serde/1.0.104/serde/ser/trait.Serialize.html#tymethod.serialize)
37+
Serialize this value into the given Serde serializer. [Read more](https://docs.rs/serde/1.0.114/serde/ser/trait.Serialize.html#tymethod.serialize)
3838

3939
## Auto Trait Implementations
4040

docs/en/api/rust/tauri/struct.AppBuilder.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,22 @@ The App builder.
1616

1717
Creates a new App bulder.
1818

19-
#### `pub fn invoke_handler<F: FnMut(&mut WebView<()>, &str) -> Result<(), String> + 'static>( self, invoke_handler: F ) -> Self`
19+
#### `pub fn invoke_handler<F: FnMut(&mut Webview, &str) -> Result<(), String> + 'static>( self, invoke_handler: F ) -> Self`
2020

2121
Defines the JS message handler callback.
2222

23-
#### `pub fn setup<F: FnMut(&mut WebView<()>, String) + 'static>( self, setup: F ) -> Self`
23+
#### `pub fn setup<F: FnMut(&mut Webview, String) + 'static>(self, setup: F) -> Self`
2424

2525
Defines the setup callback.
2626

2727
#### `pub fn splashscreen_html(self, html: &str) -> Self`
2828

2929
Defines the splashscreen HTML to render.
3030

31+
#### `pub fn plugin(self, plugin: impl Plugin + 'static) -> Self`
32+
33+
Adds a plugin to the runtime.
34+
3135
#### `pub fn build(self) -> App`
3236

3337
Builds the App.
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
---
2+
title: "struct.Webview"
3+
---
4+
5+
# Struct [tauri](/docs/api/rust/tauri/index.html)::​[Webview](/docs/api/rust/tauri/)
6+
7+
pub struct Webview<'a> { /* fields omitted */ }
8+
9+
## Methods
10+
11+
### `impl<'a> Webview<'a>`
12+
13+
#### `pub fn create(debug: bool, window: Option<&mut Window>) -> Webview`
14+
15+
#### `pub fn run(&mut self)`
16+
17+
#### `pub fn terminate(&mut self)`
18+
19+
#### `pub fn as_mut(&mut self) -> WebviewMut`
20+
21+
#### `pub fn set_title(&mut self, title: &str)`
22+
23+
#### `pub fn set_size(&mut self, width: i32, height: i32, hints: SizeHint)`
24+
25+
#### `pub fn get_window(&self) -> *mutWindow`
26+
27+
#### `pub fn navigate(&mut self, url: &'a str)`
28+
29+
#### `pub fn init(&mut self, js: &str)`
30+
31+
#### `pub fn eval(&mut self, js: &str)`
32+
33+
#### `pub fn dispatch<F>(&mut self, f: F) where F: FnOnce(&mut Webview) + Send + 'static,`
34+
35+
#### `pub fn bind<F>(&mut self, name: &str, f: F) where F: FnMut(&str, &str),`
36+
37+
#### `pub fn return(&self, seq: &str, status: i32, result: &str)`
38+
39+
## Trait Implementations
40+
41+
### `impl<'a> Clone for Webview<'a>`
42+
43+
#### `fn clone(&self) -> Webview<'a>`
44+
45+
Returns a copy of the value. [Read more](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone)
46+
47+
#### `fn clone_from(&mut self, source: &Self)`1.0.0
48+
49+
Performs copy-assignment from `source`. [Read more](https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from)
50+
51+
### `impl<'a> Drop for Webview<'a>`
52+
53+
#### `fn drop(&mut self)`
54+
55+
Executes the destructor for this type. [Read more](https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop)
56+
57+
## Auto Trait Implementations
58+
59+
### `impl<'a> RefUnwindSafe for Webview<'a>`
60+
61+
### `impl<'a> !Send for Webview<'a>`
62+
63+
### `impl<'a> !Sync for Webview<'a>`
64+
65+
### `impl<'a> Unpin for Webview<'a>`
66+
67+
### `impl<'a> UnwindSafe for Webview<'a>`
68+
69+
## Blanket Implementations
70+
71+
### `impl<T> Any for T where T: 'static + ?Sized,`
72+
73+
#### `fn type_id(&self) -> TypeId`
74+
75+
Gets the `TypeId` of `self`. [Read more](https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id)
76+
77+
### `impl<T> Borrow<T> for T where T: ?Sized,`
78+
79+
#### `fn borrow(&self) -> &T`
80+
81+
Immutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow)
82+
83+
### `impl<T> BorrowMut<T> for T where T: ?Sized,`
84+
85+
#### `fn borrow_mut(&mut self) -> &mutT`
86+
87+
Mutably borrows from an owned value. [Read more](https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut)
88+
89+
### `impl<T> From<T> for T`
90+
91+
#### `fn from(t: T) -> T`
92+
93+
Performs the conversion.
94+
95+
### `impl<T, U> Into<U> for T where U: From<T>,`
96+
97+
#### `fn into(self) -> U`
98+
99+
Performs the conversion.
100+
101+
### `impl<T> ToOwned for T where T: Clone,`
102+
103+
#### `type Owned = T`
104+
105+
The resulting type after obtaining ownership.
106+
107+
#### `fn to_owned(&self) -> T`
108+
109+
Creates owned data from borrowed data, usually by cloning. [Read more](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#tymethod.to_owned)
110+
111+
#### `fn clone_into(&self, target: &mutT)`
112+
113+
🔬 This is a nightly-only experimental API. (`toowned_clone_into`)
114+
115+
recently added
116+
117+
Uses borrowed data to replace owned data, usually by cloning. [Read more](https://doc.rust-lang.org/nightly/alloc/borrow/trait.ToOwned.html#method.clone_into)
118+
119+
### `impl<T, U> TryFrom<U> for T where U: Into<T>,`
120+
121+
#### `type Error = Infallible`
122+
123+
The type returned in the event of a conversion error.
124+
125+
#### `fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>`
126+
127+
Performs the conversion.
128+
129+
### `impl<T, U> TryInto<U> for T where U: TryFrom<T>,`
130+
131+
#### `type Error = <U as TryFrom<T>>::Error`
132+
133+
The type returned in the event of a conversion error.
134+
135+
#### `fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>`
136+
137+
Performs the conversion.
138+
139+
### `impl<V, T> VZip<V> for T where V: MultiLane<T>,`
140+
141+
#### `fn vzip(self) -> V`

0 commit comments

Comments
 (0)