Skip to main content

CapabilityRequirement

Struct CapabilityRequirement 

Source
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: u32

Minimum acceptable worker wire protocol.

§needs_cargo: bool

Whether 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: bool

Whether a working bun runtime is required.

§needs_node: bool

Whether a working node runtime is required.

§needs_go: bool

Whether a working Go toolchain is required.

§needs_zig: bool

Whether zig + cargo-zigbuild are required (a cargo zigbuild cross-compile). Enforced ON TOP OF needs_cargo and needs_targets.

§needs_nix: bool

Whether 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

Source

pub fn rust(min_protocol: u32) -> Self

A bare Rust build requirement (cargo, given wire protocol).

Source

pub fn with_targets<I, S>(self, targets: I) -> Self
where I: IntoIterator<Item = S>, S: Into<String>,

Require these rustup targets (builder style).

Source

pub fn with_os(self, os: impl Into<String>) -> Self

Require a host OS (e.g. linux / darwin).

Source

pub fn with_arch(self, arch: impl Into<String>) -> Self

Require a host arch (e.g. x86_64 / aarch64).

Source

pub fn with_tools<I, S>(self, tools: I) -> Self
where I: IntoIterator<Item = S>, S: Into<String>,

Require verified named tools (builder style).

Source

pub fn with_toolchains<I, S>(self, toolchains: I) -> Self
where I: IntoIterator<Item = S>, S: Into<String>,

Require specific rustup toolchains (builder style).

Trait Implementations§

Source§

impl Clone for CapabilityRequirement

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CapabilityRequirement

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CapabilityRequirement

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more