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) -> RustProjectBuild 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.
| Parameter | Type | Default | Description |
|---|---|---|---|
path | str | '.' | Path to the crate or workspace root. |
version | str | 'stable' | rustup channel name ("stable") or a pinned version |
("1.81.0"). | |||
image | str | None | None | Local-mode Docker base image override. |
components | tuple[str, ...] | ('clippy', 'rustfmt') | rustup components to install alongside the toolchain. |
Defaults to ("clippy", "rustfmt"). | |||
base | Step | None | None | Existing Step to attach to instead of emitting a fresh |
| apt-base step. | |||
cache | CachePolicy | None | None | Override 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) -> RustToolchainInstall 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.
| Parameter | Type | Default | Description |
|---|---|---|---|
path | str | '.' | Path to the crate or workspace root. |
version | str | 'stable' | rustup channel name ("stable") or a pinned version |
("1.81.0"). | |||
image | str | None | None | Local-mode Docker base image override. |
components | tuple[str, ...] | ('clippy', 'rustfmt') | rustup components to install alongside the toolchain. |
Defaults to ("clippy", "rustfmt"). | |||
base | Step | None | None | Existing 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) -> RustProjectBuild 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.
| Parameter | Type | Default | Description |
|---|---|---|---|
path | str | '.' | Path to the crate or workspace root. |
version | str | 'stable' | rustup channel name ("stable") or a pinned version |
("1.81.0"). | |||
image | str | None | None | Local-mode Docker base image override. |
components | tuple[str, ...] | ('clippy', 'rustfmt') | rustup components to install alongside the toolchain. |
Defaults to ("clippy", "rustfmt"). | |||
base | Step | None | None | Existing Step to attach to instead of emitting a fresh |
| apt-base step. | |||
cache | CachePolicy | None | None | Override 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) -> RustToolchainInstall 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.
| Parameter | Type | Default | Description |
|---|---|---|---|
path | str | '.' | Path to the crate or workspace root. |
version | str | 'stable' | rustup channel name ("stable") or a pinned version |
("1.81.0"). | |||
image | str | None | None | Local-mode Docker base image override. |
components | tuple[str, ...] | ('clippy', 'rustfmt') | rustup components to install alongside the toolchain. |
Defaults to ("clippy", "rustfmt"). | |||
base | Step | None | None | Existing 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
| Field | Type | Default |
|---|---|---|
toolchain | RustToolchain | required |
warmup | Step | required |
RustProject.clippy()
clippy(*, flags=(), **kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
flags | tuple[str, ...] | () | — |
kw | Any | {} | — |
Returns Step
RustProject.fmt()
fmt(*, flags=(), **kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
flags | tuple[str, ...] | () | — |
kw | Any | {} | — |
Returns Step
RustProject.test()
test(*, flags=(), packages=(), **kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
flags | tuple[str, ...] | () | — |
packages | tuple[str, ...] | () | — |
kw | Any | {} | — |
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
| Field | Type | Default |
|---|---|---|
path | str | required |
installed | Step | required |
RustToolchain.build()
build(*, release=False, **kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
release | bool | False | — |
kw | Any | {} | — |
Returns Step
RustToolchain.clippy()
clippy(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
RustToolchain.doc()
doc(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
RustToolchain.fmt()
fmt(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step
RustToolchain.test()
test(*, release=False, **kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
release | bool | False | — |
kw | Any | {} | — |
Returns Step
RustToolchain.warmup()
warmup(**kw) -> Step| Parameter | Type | Default | Description |
|---|---|---|---|
kw | Any | {} | — |
Returns Step