Struct TauriHelperOptions

Source
pub struct TauriHelperOptions {
    pub collect_all: bool,
}
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: bool

Determines 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.

Implementations§

Trait Implementations§

Source§

impl Default for TauriHelperOptions

Source§

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

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<TauriHelperOptions, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,