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 are specifically designed to be extended by nmk projects and plugins.

Paths and files

rustSrcFolder – Rust source code folder

Type

Default value

str

${sourceDir}

This is the path nmk will browse to find source files.

rustSrcFiles – Rust source files

Type

Default value

list[Path]

Generated by nmk_rust.resolvers.RustSourcesResolver

This is the list of source files for this rust project (found in ${rustSrcFolder}).

rustTargetFolder – Rust target binary folder

Type

Default value

str

${outputDir}/rust

This is the path where cargo will generate built artifacts

rustConfigFolder – Rust (cargo) configuration folder

Type

Default value

str

${PROJECTDIR}/.cargo

This is the path where cargo will look for its configuration file

rustConfigFile – Rust (cargo) configuration file

Type

Default value

str

${rustSrcFolder}/config.toml

This is the cargo configuration file for the current project. It is generated by the rust.config task.

rustManifestFile – Rust (cargo) package manifest file

Type

Default value

str

${PROJECTDIR}/Cargo.toml

This is the cargo package manifest file for the current project. It is generated by the rust.manifest task.

Rust Package

rustPackage – Rust package name

Type

Default value

str

${projectName}

This is the rust package name to insert when generating ${rustManifestFile} manifest file.

rustEdition – Rust edition for manifest file

Type

Default value

int

2021

This is the rust edition to insert when generating ${rustManifestFile} manifest file.

Cargo configuration

rustConfigFileFragments – Cargo config file fragments

Type

Default value

list[str]

[“<nmk_rust>/templates/config.toml.jinja”]

This is a list of config fragment files to be merged in generated ${rustConfigFile} file.

rustConfigFileItems – Cargo config file contributed items

Type

Default value

Dict

{}

This is a dictionary of items to be contributed in generated ${rustConfigFile} file.

rustManifestFileFragments – Cargo manifest file fragments

Type

Default value

list[str]

[“<nmk_rust>/templates/manifest.toml.jinja”]

This is a list of manifest fragment files to be merged in generated ${rustManifestFile} file.

rustManifestFileItems – Cargo manifest file contributed items

Type

Default value

Dict

{}

This is a dictionary of items to be contributed in generated ${rustManifestFile} file.

Code format

rustFormatFile – rustfmt configuration file

Type

Default value

str

“${PROJECTDIR}/.rustfmt.toml”

This is the rustfmt configuration file for the project.

rustFormatFileFragments – Cargo manifest file fragments

Type

Default value

list[str]

[“<nmk_rust>/templates/rustfmt.toml.jinja”]

This is a list of manifest fragment files to be merged in generated ${rustFormatFile} file.

rustFormatFileItems – Cargo manifest file contributed items

Type

Default value

Dict

{}

This is a dictionary of items to be contributed in generated ${rustFormatFile} file.

rustLineLength – Rust code line length

Type

Default value

int

160

This is the configured width for rust source code lines, when formatting code.

rustFormatStampFile – Code format stamp file

Type

Default value

str

${outputDir}/.rustfmt

Stamp file updated each time code format task is executed (for incremental build).

rustFormatExtraArgscargo fmt extra command line args

Type

Default value

list[str]

[“-v”]

List of cargo fmt command extra arguments when formatting code.