Skip to content

Commit

Permalink
fix Builder::manage docs
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed Jun 20, 2023
1 parent 79b3dca commit 627bc27
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/tauri/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1207,14 +1207,19 @@ impl<R: Runtime> Builder<R> {

/// 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`
/// is managed by Tauri, adding `State<T>` to the list of arguments in a
/// 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:
Expand Down

0 comments on commit 627bc27

Please sign in to comment.