diff --git a/core/tauri/src/app.rs b/core/tauri/src/app.rs index d162b481c45..97652556f28 100644 --- a/core/tauri/src/app.rs +++ b/core/tauri/src/app.rs @@ -1207,7 +1207,8 @@ impl Builder { /// Add `state` to the state managed by the application. /// - /// If the state for the `T` type has previously been set, the state is unchanged and false is returned. Otherwise true is returned. + /// This method can be called any number of times as long as each call + /// refers to a different `T`. /// /// Managed state can be retrieved by any command handler via the /// [`State`](crate::State) guard. In particular, if a value of type `T` @@ -1215,6 +1216,10 @@ impl Builder { /// command handler instructs Tauri to retrieve the managed value. /// Additionally, [`state`](crate::Manager#method.state) can be used to retrieve the value manually. /// + /// # Panics + /// + /// Panics if state of type `T` is already being managed. + /// /// # Mutability /// /// Since the managed state is global and must be [`Send`] + [`Sync`], mutations can only happen through interior mutability: