mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-03 10:11:15 +02:00
This commit is contained in:
committed by
GitHub
parent
35588b2e04
commit
3f3599b9cc
5
.changes/setup-fn-once.md
Normal file
5
.changes/setup-fn-once.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri": "patch"
|
||||
---
|
||||
|
||||
`Builder#setup` closure type changed from `Fn` to `FnOnce`.
|
||||
@@ -677,7 +677,7 @@ impl<R: Runtime> Builder<R> {
|
||||
/// Defines the setup hook.
|
||||
pub fn setup<F>(mut self, setup: F) -> Self
|
||||
where
|
||||
F: Fn(&mut App<R>) -> Result<(), Box<dyn std::error::Error + Send>> + Send + 'static,
|
||||
F: FnOnce(&mut App<R>) -> Result<(), Box<dyn std::error::Error + Send>> + Send + 'static,
|
||||
{
|
||||
self.setup = Box::new(setup);
|
||||
self
|
||||
|
||||
@@ -16,7 +16,7 @@ use tauri_macros::default_runtime;
|
||||
|
||||
/// A closure that is run when the Tauri application is setting up.
|
||||
pub type SetupHook<R> =
|
||||
Box<dyn Fn(&mut App<R>) -> Result<(), Box<dyn std::error::Error + Send>> + Send>;
|
||||
Box<dyn FnOnce(&mut App<R>) -> Result<(), Box<dyn std::error::Error + Send>> + Send>;
|
||||
|
||||
/// A closure that is run everytime Tauri receives a message it doesn't explicitly handle.
|
||||
pub type InvokeHandler<R> = dyn Fn(Invoke<R>) + Send + Sync + 'static;
|
||||
|
||||
Reference in New Issue
Block a user