pub struct CapabilityRequirement {Show 13 fields
pub needs_targets: Vec<String>,
pub min_protocol: u32,
pub needs_cargo: bool,
pub needs_os: Option<String>,
pub needs_arch: Option<String>,
pub needs_bun: bool,
pub needs_node: bool,
pub needs_go: bool,
pub needs_zig: bool,
pub needs_nix: bool,
pub needs_toolchains: Vec<String>,
pub needs_components: Vec<String>,
pub needs_tools: Vec<String>,
}Expand description
What a command needs from a worker before it is admissible.
Fields§
§needs_targets: Vec<String>rustup targets the build needs (e.g. wasm32-unknown-unknown).
min_protocol: u32Minimum acceptable worker wire protocol.
needs_cargo: boolWhether a working cargo is required.
needs_os: Option<String>Required host OS for the produced artifact (e.g. linux, darwin).
Matched case-insensitively against the worker’s probed os.
needs_arch: Option<String>Required host arch (e.g. x86_64, aarch64), matched case-insensitively.
needs_bun: boolWhether a working bun runtime is required.
needs_node: boolWhether a working node runtime is required.
needs_go: boolWhether a working Go toolchain is required.
needs_zig: boolWhether zig + cargo-zigbuild are required (a cargo zigbuild
cross-compile). Enforced ON TOP OF needs_cargo and needs_targets.
needs_nix: boolWhether a working nix (binary + populated /nix/store) is required.
needs_toolchains: Vec<String>Specific rustup toolchains the build needs (prefix-matched against the
worker’s installed toolchains, e.g. nightly-2025-11-01 matches
nightly-2025-11-01-x86_64-unknown-linux-gnu).
needs_components: Vec<String>Rustup components the build needs, each as "<toolchain>:<component>"
(e.g. "nightly:clippy"). The toolchain half is prefix-matched exactly
like Self::needs_toolchains; the component half must match exactly.
Components are toolchain-scoped on purpose: a worker holding clippy
for stable cannot lint a project that pins a nightly, and without this
the scheduler routed lint work to such a worker and surfaced
error: 'cargo-clippy' is not installed for the toolchain '...' as a
plain exit 1 — indistinguishable from a real lint failure (bd-vc61a).
Empty by default, so this constrains nothing until a caller opts in.
needs_tools: Vec<String>Operator-declared named tools the work needs verified on the worker
(rch exec --job --require-tool NAME, or a project’s
jobs.required_tools).
Empty by default: no requirement means no gate. A name no worker declares a probe for is inadmissible EVERYWHERE rather than ignored — a typo that silently disabled the gate would be worse than a refusal, because the caller asked for the gate precisely because the job cannot run without the tool.
Implementations§
Source§impl CapabilityRequirement
impl CapabilityRequirement
Sourcepub fn rust(min_protocol: u32) -> Self
pub fn rust(min_protocol: u32) -> Self
A bare Rust build requirement (cargo, given wire protocol).
Sourcepub fn with_targets<I, S>(self, targets: I) -> Self
pub fn with_targets<I, S>(self, targets: I) -> Self
Require these rustup targets (builder style).
Sourcepub fn with_arch(self, arch: impl Into<String>) -> Self
pub fn with_arch(self, arch: impl Into<String>) -> Self
Require a host arch (e.g. x86_64 / aarch64).
Sourcepub fn with_tools<I, S>(self, tools: I) -> Self
pub fn with_tools<I, S>(self, tools: I) -> Self
Require verified named tools (builder style).
Sourcepub fn with_toolchains<I, S>(self, toolchains: I) -> Self
pub fn with_toolchains<I, S>(self, toolchains: I) -> Self
Require specific rustup toolchains (builder style).