# Configuration Reference The **`nmk-rust`** plugin handles the configuration items listed in this page. All of them are initiliazed with convenient default values, so that you don't need to setup them for a default working behavior. You can anyway override them in your projet if you need to fine tune the plugin behavior. [Some items](extend.md) are specifically designed to be extended by **`nmk`** projects and plugins. ## Paths and files (rustSrcFolder)= ### **`rustSrcFolder`** -- Rust source code folder | Type | Default value | |- |- | str | [${sourceDir}](https://nmk-base.readthedocs.io/en/stable/config.html#sourcedir-source-base-directory) This is the path **`nmk`** will browse to find source files. (rustSrcFiles)= ### **`rustSrcFiles`** -- Rust source files | Type | Default value | |- |- | list[Path] | Generated by {py:class}`nmk_rust.resolvers.RustSourcesResolver` This is the list of source files for this rust project (found in **{ref}`${rustSrcFolder}`**). (rustTargetFolder)= ### **`rustTargetFolder`** -- Rust target binary folder | Type | Default value | |- |- | str | [${outputDir}](https://nmk-base.readthedocs.io/en/stable/config.html#outputdir-output-base-directory)/rust This is the path where **`cargo`** will generate built artifacts (rustConfigFolder)= ### **`rustConfigFolder`** -- Rust (cargo) configuration folder | Type | Default value | |- |- | str | ${PROJECTDIR}/.cargo This is the path where **`cargo`** will look for its configuration file (rustConfigFile)= ### **`rustConfigFile`** -- Rust (cargo) configuration file | Type | Default value | |- |- | str | **{ref}`${rustSrcFolder}`**/config.toml This is the **`cargo`** [configuration file](https://doc.rust-lang.org/cargo/reference/config.html) for the current project. It is generated by the **{ref}`rust.config`** task. (rustManifestFile)= ### **`rustManifestFile`** -- Rust (cargo) package manifest file | Type | Default value | |- |- | str | ${PROJECTDIR}/Cargo.toml This is the **`cargo`** package [manifest file](https://doc.rust-lang.org/cargo/reference/manifest.html) for the current project. It is generated by the **{ref}`rust.manifest`** task. ## Rust Package (rustPackage)= ### **`rustPackage`** -- Rust package name | Type | Default value | |- |- | str | [${projectName}](https://nmk-base.readthedocs.io/en/stable/config.html#projectname) This is the rust package name to insert when generating **{ref}`${rustManifestFile}`** manifest file. (rustEdition)= ### **`rustEdition`** -- Rust edition for manifest file | Type | Default value | |- |- | int | 2021 This is the [rust edition](https://doc.rust-lang.org/edition-guide/) to insert when generating **{ref}`${rustManifestFile}`** manifest file. ## Cargo configuration (rustConfigFileFragments)= ### **`rustConfigFileFragments`** -- Cargo config file fragments | Type | Default value | |- |- | list[str] | ["/templates/config.toml.jinja"] This is a list of config fragment files to be merged in generated **{ref}`${rustConfigFile}`** file. (rustConfigFileItems)= ### **`rustConfigFileItems`** -- Cargo config file contributed items | Type | Default value | |- |- | Dict | {} This is a dictionary of items to be contributed in generated **{ref}`${rustConfigFile}`** file. (rustManifestFileFragments)= ### **`rustManifestFileFragments`** -- Cargo manifest file fragments | Type | Default value | |- |- | list[str] | ["/templates/manifest.toml.jinja"] This is a list of manifest fragment files to be merged in generated **{ref}`${rustManifestFile}`** file. (rustManifestFileItems)= ### **`rustManifestFileItems`** -- Cargo manifest file contributed items | Type | Default value | |- |- | Dict | {} This is a dictionary of items to be contributed in generated **{ref}`${rustManifestFile}`** file. ## Code format (rustFormatFile)= ### **`rustFormatFile`** -- rustfmt configuration file | Type | Default value | |- |- | str | "${PROJECTDIR}/.rustfmt.toml" This is the **`rustfmt`** [configuration file](https://rust-lang.github.io/rustfmt/) for the project. (rustFormatFileFragments)= ### **`rustFormatFileFragments`** -- Cargo manifest file fragments | Type | Default value | |- |- | list[str] | ["/templates/rustfmt.toml.jinja"] This is a list of manifest fragment files to be merged in generated **{ref}`${rustFormatFile}`** file. (rustFormatFileItems)= ### **`rustFormatFileItems`** -- Cargo manifest file contributed items | Type | Default value | |- |- | Dict | {} This is a dictionary of items to be contributed in generated **{ref}`${rustFormatFile}`** file. (rustLineLength)= ### **`rustLineLength`** -- Rust code line length | Type | Default value | |- |- | int | 160 This is the configured width for rust source code lines, when formatting code. (rustFormatStampFile)= ### **`rustFormatStampFile`** -- Code format stamp file | Type | Default value | |- |- | str | [${outputDir}](https://nmk-base.readthedocs.io/en/stable/config.html#outputdir-output-base-directory)/.rustfmt Stamp file updated each time code format task is executed (for incremental build). (rustFormatExtraArgs)= ### **`rustFormatExtraArgs`** -- `cargo fmt` extra command line args | Type | Default value | |- |- | list[str] | ["-v"] List of **`cargo fmt`** command extra arguments when formatting code.