pub struct TauriHelperOptions {
pub collect_all: bool,
pub members: Option<Vec<String>>,
}Expand description
Configuration options for the tauri_helper crate.
This struct allows you to customize the behavior of the command collection process.
Fields§
§collect_all: boolDetermines whether to collect all functions annotated with #[tauri::command]
regardless of whether they also have the #[auto_collect_command] attribute.
When set to true, the crate will scan for and collect all functions marked
with #[tauri::command], even if they do not have the #[auto_collect_command] attribute.
When set to false (the default), only functions with both #[tauri::command]
and #[auto_collect_command] will be collected.
§Recommendation
It is strongly recommended to keep this option set to false (the default) and
explicitly annotate the functions you want to collect with #[auto_collect_command].
This ensures better control over which commands are included in your Tauri application
and avoids accidentally collecting unintended commands.
§Example
#[tauri::command]
#[auto_collect_command] // Explicitly opt-in to command collection
fn my_command() {
println!("Good Opt-In")
}Setting collect_all to true should only be used in specific cases where you
want to automatically collect all #[tauri::command] functions without explicit
opt-in. Use this option with caution.
members: Option<Vec<String>>Members of the workspace to scan, if None it will just scan every member
Implementations§
Trait Implementations§
Source§impl Default for TauriHelperOptions
impl Default for TauriHelperOptions
Source§fn default() -> TauriHelperOptions
fn default() -> TauriHelperOptions
Provides a default configuration for TauriHelperOptions.
By default, collect_all is set to false, meaning only functions annotated with
both #[tauri::command] and #[auto_collect_command] will be collected.
This default behavior is recommended for most use cases to ensure explicit control over which commands are included in your Tauri application.
Source§impl<'de> Deserialize<'de> for TauriHelperOptions
impl<'de> Deserialize<'de> for TauriHelperOptions
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TauriHelperOptions, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TauriHelperOptions, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for TauriHelperOptions
impl RefUnwindSafe for TauriHelperOptions
impl Send for TauriHelperOptions
impl Sync for TauriHelperOptions
impl Unpin for TauriHelperOptions
impl UnsafeUnpin for TauriHelperOptions
impl UnwindSafe for TauriHelperOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more