Argument

Struct Argument 

Source
pub struct Argument {
    pub Directory: String,
    pub Name: String,
    pub Prefix: String,
    pub Browser: Option<String>,
    pub Bundle: Option<String>,
    pub Compile: Option<String>,
    pub Clean: Option<String>,
    pub Debug: Option<String>,
    pub Dependency: Option<String>,
    pub Environment: Option<String>,
    pub NodeVersion: Option<String>,
    pub Command: Vec<String>,
}
Expand description

Represents parsed command-line arguments and environment variables that control the build.

This struct is generated by clap from the Parser derive macro and automatically parses command-line arguments and environment variables into a strongly-typed configuration object. Each field can be configured via:

  • Command-line arguments (long form, e.g., --directory)
  • Environment variables (as specified in the env attribute)
  • Default values (as specified in the default_value attribute)

Required fields must be provided, while optional fields can be omitted. The Command field is special in that it accepts all remaining arguments as the build command to execute.

§Field Descriptions

  • Directory: The main directory of the project containing Cargo.toml
  • Name: The original base name of the project/package
  • Prefix: The prefix for the application’s bundle identifier
  • Browser: Flag for browser-specific build aspects
  • Bundle: Flag for bundling-specific aspects
  • Compile: Flag for compile-specific aspects
  • Clean: Flag for cleaning-specific aspects
  • Debug: Flag for debug-specific aspects
  • Dependency: Information about a dependency (org/repo or boolean)
  • Environment: The Node.js environment (development, production, etc.)
  • NodeVersion: The Node.js sidecar version to bundle
  • Command: The build command and its arguments to execute

Fields§

§Directory: String

The main directory of the project.

This field specifies the project directory that contains the Cargo.toml and tauri.conf.json files. It can be set via:

  • Command-line: --directory <path>
  • Environment: MOUNTAIN_DIR
  • Default: “Element/Mountain”
§Name: String

The original base name of the project/package.

This field specifies the base name of the project, which serves as the suffix for generated product names. It can be set via:

  • Command-line: --name <name>
  • Environment: MOUNTAIN_ORIGINAL_BASE_NAME
  • Default: “Mountain”
§Prefix: String

The prefix for the application’s bundle identifier.

This field specifies the reverse domain prefix for the bundle identifier. It can be set via:

  • Command-line: --prefix <prefix>
  • Environment: MOUNTAIN_BUNDLE_ID_PREFIX
  • Default: “land.editor.binary”
§Browser: Option<String>

Flag or value indicating browser-specific build aspects.

When set to “true”, enables browser-specific configuration and affects the generated product name and bundle identifier.

§Bundle: Option<String>

Flag or value indicating bundling-specific aspects.

When set to “true”, enables bundling-specific configuration and affects the generated product name and bundle identifier.

§Compile: Option<String>

Flag or value indicating compile-specific aspects.

When set to “true”, enables compile-specific configuration and affects the generated product name and bundle identifier.

§Clean: Option<String>

Flag or value indicating cleaning-specific aspects.

When set to “true”, enables clean-specific configuration and affects the generated product name and bundle identifier.

§Debug: Option<String>

Flag or value indicating debug-specific aspects.

When set to “true”, enables debug-specific configuration and affects the generated product name and bundle identifier. Also automatically detected if the command contains “–debug”.

§Dependency: Option<String>

Information about a dependency, often ‘org/repo’ or a boolean string.

This field specifies dependency information that affects the generated product name and bundle identifier. Can be:

  • “true” for generic dependencies
  • “org/repo” for specific repository dependencies
  • Any custom string
§Environment: Option<String>

The Node.js environment (e.g., “development”, “production”).

This field specifies the Node.js runtime environment and affects the generated product name and bundle identifier.

§NodeVersion: Option<String>

Specifies the Node.js sidecar version to bundle (e.g., “22”).

This field specifies which Node.js version should be bundled as a sidecar binary with the application. The executable is sourced from the Element/SideCar directory.

§Command: Vec<String>

The build command and its arguments to execute.

This field accepts all remaining command-line arguments as the build command to execute after configuring the project files. This field is required and must be provided as the final arguments.

Example: pnpm tauri build

Trait Implementations§

Source§

impl Args for Argument

Source§

fn group_id() -> Option<Id>

Report the [ArgGroup::id][crate::ArgGroup::id] for this set of arguments
Source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate Self via [FromArgMatches::from_arg_matches_mut] Read more
Source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate self via [FromArgMatches::update_from_arg_matches_mut] Read more
Source§

impl Clone for Argument

Source§

fn clone(&self) -> Argument

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl CommandFactory for Argument

Source§

fn command<'b>() -> Command

Build a [Command] that can instantiate Self. Read more
Source§

fn command_for_update<'b>() -> Command

Build a [Command] that can update self. Read more
Source§

impl Debug for Argument

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for Argument

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Parser for Argument

§

fn parse() -> Self

Parse from std::env::args_os(), [exit][Error::exit] on error.
§

fn try_parse() -> Result<Self, Error>

Parse from std::env::args_os(), return Err on error.
§

fn parse_from<I, T>(itr: I) -> Self
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, [exit][Error::exit] on error.
§

fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, return Err on error.
§

fn update_from<I, T>(&mut self, itr: I)
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, [exit][Error::exit] on error. Read more
§

fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, return Err on error.

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.