From e23728edb6d8d08187d3743bf9e6dc3214698ea5 Mon Sep 17 00:00:00 2001 From: Chip Reed Date: Mon, 29 Jul 2024 14:49:34 +0900 Subject: [PATCH] mark config and acl items as unstable give some doc tips if they need to be used from Rust --- core/tauri-utils/src/acl/mod.rs | 17 +++++++++++++++++ core/tauri-utils/src/config.rs | 13 +++++++++++++ 2 files changed, 30 insertions(+) diff --git a/core/tauri-utils/src/acl/mod.rs b/core/tauri-utils/src/acl/mod.rs index 0016a4682..6d574263d 100644 --- a/core/tauri-utils/src/acl/mod.rs +++ b/core/tauri-utils/src/acl/mod.rs @@ -3,6 +3,23 @@ // SPDX-License-Identifier: MIT //! Access Control List types. +//! +//! # Stability +//! +//! This is a core functionality that is not considered part of the stable API. +//! If you use it, note that it may include breaking changes in the future. +//! +//! These items are intended to be non-breaking from a de/serialization standpoint only. +//! Using and modifying existing config values will try to avoid breaking changes, but they are +//! free to add fields in the future - causing breaking changes for creating and full destructuring. +//! +//! To avoid this, [ignore unknown fields when destructuring] with the `{my, config, ..}` pattern. +//! If you need to create the Rust config directly without deserializing, then create the struct +//! the [Struct Update Syntax] with `..Default::default()`, which may need a +//! `#[allow(clippy::needless_update)]` attribute if you are declaring all fields. +//! +//! [ignore unknown fields when destructuring]: https://doc.rust-lang.org/book/ch18-03-pattern-syntax.html#ignoring-remaining-parts-of-a-value-with- +//! [Struct Update Syntax]: https://doc.rust-lang.org/book/ch05-01-defining-structs.html#creating-instances-from-other-instances-with-struct-update-syntax use serde::{Deserialize, Serialize}; use std::{num::NonZeroU64, str::FromStr, sync::Arc}; diff --git a/core/tauri-utils/src/config.rs b/core/tauri-utils/src/config.rs index 90e41c635..0e18a7c76 100644 --- a/core/tauri-utils/src/config.rs +++ b/core/tauri-utils/src/config.rs @@ -7,8 +7,21 @@ //! It is pulled from a `tauri.conf.json` file and the [`Config`] struct is generated at compile time. //! //! # Stability +//! //! This is a core functionality that is not considered part of the stable API. //! If you use it, note that it may include breaking changes in the future. +//! +//! These items are intended to be non-breaking from a de/serialization standpoint only. +//! Using and modifying existing config values will try to avoid breaking changes, but they are +//! free to add fields in the future - causing breaking changes for creating and full destructuring. +//! +//! To avoid this, [ignore unknown fields when destructuring] with the `{my, config, ..}` pattern. +//! If you need to create the Rust config directly without deserializing, then create the struct +//! the [Struct Update Syntax] with `..Default::default()`, which may need a +//! `#[allow(clippy::needless_update)]` attribute if you are declaring all fields. +//! +//! [ignore unknown fields when destructuring]: https://doc.rust-lang.org/book/ch18-03-pattern-syntax.html#ignoring-remaining-parts-of-a-value-with- +//! [Struct Update Syntax]: https://doc.rust-lang.org/book/ch05-01-defining-structs.html#creating-instances-from-other-instances-with-struct-update-syntax #[cfg(feature = "schema")] use schemars::JsonSchema;