Harmont docs
Pipeline SDKReferenceToolchains

Rust

Generated reference for the harmont Rust API.

rust

Namespace for hm.rust.toolchain() and hm.rust.project().

rust.project()

project(*, path='.', version='stable', image=None, components=('clippy', 'rustfmt'), base=None, cache=None) -> RustProject

Build a high-level Rust CI DAG.

Installs the toolchain via rustup, warms a dependency cache keyed on Cargo.lock, and returns a RustProject whose .test(), .clippy(), and .fmt() methods build on that warmup step so dependency compilation is shared.

ParameterTypeDefaultDescription
pathstr'.'Path to the crate or workspace root.
versionstr'stable'rustup channel name ("stable") or a pinned version
("1.81.0").
imagestr | NoneNoneLocal-mode Docker base image override.
componentstuple[str, ...]('clippy', 'rustfmt')rustup components to install alongside the toolchain.
Defaults to ("clippy", "rustfmt").
baseStep | NoneNoneExisting Step to attach to instead of emitting a fresh
apt-base step.
cacheCachePolicy | NoneNoneOverride the warmup step's cache policy. Defaults to
CacheOnChange keyed on Cargo.lock.

Returns RustProject — A RustProject exposing the common CI steps.

Examples

>>> import harmont as hm
>>> proj = hm.rust.project()
>>> hm.group([proj.test(), proj.clippy(), proj.fmt()])

rust.toolchain()

toolchain(*, path='.', version='stable', image=None, components=('clippy', 'rustfmt'), base=None) -> RustToolchain

Install the Rust toolchain via rustup.

Produces a RustToolchain whose installed step is the rustup-install step. Action methods on the toolchain attach leaves to installed. Use project() instead when you want a pre-built warmup step shared across test/clippy/fmt.

ParameterTypeDefaultDescription
pathstr'.'Path to the crate or workspace root.
versionstr'stable'rustup channel name ("stable") or a pinned version
("1.81.0").
imagestr | NoneNoneLocal-mode Docker base image override.
componentstuple[str, ...]('clippy', 'rustfmt')rustup components to install alongside the toolchain.
Defaults to ("clippy", "rustfmt").
baseStep | NoneNoneExisting Step to attach the toolchain install to instead
of emitting a fresh apt-base step. Use to share one apt-base
across multiple toolchains.

Returns RustToolchain — A RustToolchain ready for action methods.

Examples

>>> import harmont as hm
>>> tc = hm.rust.toolchain(version="1.81.0")
>>> hm.pipeline(tc.test(), tc.clippy())

RustEntry

Namespace for hm.rust.toolchain() and hm.rust.project().

RustEntry.project()

project(*, path='.', version='stable', image=None, components=('clippy', 'rustfmt'), base=None, cache=None) -> RustProject

Build a high-level Rust CI DAG.

Installs the toolchain via rustup, warms a dependency cache keyed on Cargo.lock, and returns a RustProject whose .test(), .clippy(), and .fmt() methods build on that warmup step so dependency compilation is shared.

ParameterTypeDefaultDescription
pathstr'.'Path to the crate or workspace root.
versionstr'stable'rustup channel name ("stable") or a pinned version
("1.81.0").
imagestr | NoneNoneLocal-mode Docker base image override.
componentstuple[str, ...]('clippy', 'rustfmt')rustup components to install alongside the toolchain.
Defaults to ("clippy", "rustfmt").
baseStep | NoneNoneExisting Step to attach to instead of emitting a fresh
apt-base step.
cacheCachePolicy | NoneNoneOverride the warmup step's cache policy. Defaults to
CacheOnChange keyed on Cargo.lock.

Returns RustProject — A RustProject exposing the common CI steps.

Examples

>>> import harmont as hm
>>> proj = hm.rust.project()
>>> hm.group([proj.test(), proj.clippy(), proj.fmt()])

RustEntry.toolchain()

toolchain(*, path='.', version='stable', image=None, components=('clippy', 'rustfmt'), base=None) -> RustToolchain

Install the Rust toolchain via rustup.

Produces a RustToolchain whose installed step is the rustup-install step. Action methods on the toolchain attach leaves to installed. Use project() instead when you want a pre-built warmup step shared across test/clippy/fmt.

ParameterTypeDefaultDescription
pathstr'.'Path to the crate or workspace root.
versionstr'stable'rustup channel name ("stable") or a pinned version
("1.81.0").
imagestr | NoneNoneLocal-mode Docker base image override.
componentstuple[str, ...]('clippy', 'rustfmt')rustup components to install alongside the toolchain.
Defaults to ("clippy", "rustfmt").
baseStep | NoneNoneExisting Step to attach the toolchain install to instead
of emitting a fresh apt-base step. Use to share one apt-base
across multiple toolchains.

Returns RustToolchain — A RustToolchain ready for action methods.

Examples

>>> import harmont as hm
>>> tc = hm.rust.toolchain(version="1.81.0")
>>> hm.pipeline(tc.test(), tc.clippy())

RustProject

High-level Rust CI DAG — constructed via hm.rust.project().

Wraps a RustToolchain and a pre-built warmup step. Action methods (test, clippy, fmt) attach leaves to the warmup so dependency compilation is shared across CI actions.

Fields

FieldTypeDefault
toolchainRustToolchainrequired
warmupSteprequired

RustProject.clippy()

clippy(*, flags=(), **kw) -> Step
ParameterTypeDefaultDescription
flagstuple[str, ...]()
kwAny{}

Returns Step

RustProject.fmt()

fmt(*, flags=(), **kw) -> Step
ParameterTypeDefaultDescription
flagstuple[str, ...]()
kwAny{}

Returns Step

RustProject.test()

test(*, flags=(), packages=(), **kw) -> Step
ParameterTypeDefaultDescription
flagstuple[str, ...]()
packagestuple[str, ...]()
kwAny{}

Returns Step

RustToolchain

Rust toolchain install chain — constructed via hm.rust.toolchain().

Holds the install step produced by rustup. Action methods (build, test, clippy, fmt, doc) attach leaves to installed.

Fields

FieldTypeDefault
pathstrrequired
installedSteprequired

RustToolchain.build()

build(*, release=False, **kw) -> Step
ParameterTypeDefaultDescription
releaseboolFalse
kwAny{}

Returns Step

RustToolchain.clippy()

clippy(**kw) -> Step
ParameterTypeDefaultDescription
kwAny{}

Returns Step

RustToolchain.doc()

doc(**kw) -> Step
ParameterTypeDefaultDescription
kwAny{}

Returns Step

RustToolchain.fmt()

fmt(**kw) -> Step
ParameterTypeDefaultDescription
kwAny{}

Returns Step

RustToolchain.test()

test(*, release=False, **kw) -> Step
ParameterTypeDefaultDescription
releaseboolFalse
kwAny{}

Returns Step

RustToolchain.warmup()

warmup(**kw) -> Step
ParameterTypeDefaultDescription
kwAny{}

Returns Step

On this page