Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(core): fix panic section on manage documentation #7251

Merged
merged 2 commits into from
Jun 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/tauri/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1214,6 +1214,7 @@ impl<R: Runtime> Builder<R> {
/// [`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
///
Expand Down
9 changes: 2 additions & 7 deletions core/tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -756,18 +756,13 @@ pub trait Manager<R: Runtime>: sealed::ManagerBase<R> {

/// Add `state` to the state managed by the application.
///
/// This method can be called any number of times as long as each call
/// refers to a different `T`.
/// If a state for `T` is already managed, the function returns false and the value is ignored.
/// If the state for the `T` type has previously been set, the state is unchanged and false is returned. Otherwise true is returned.
///
/// 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.
///
/// # Panics
///
/// Panics if state of type `T` is already being managed.
/// Additionally, [`state`](Self#method.state) can be used to retrieve the value manually.
///
/// # Mutability
///
Expand Down
Loading