Skip to main content

AgentRequest

Enum AgentRequest 

Source
pub enum AgentRequest {
Show 26 variants Hello { protocol: u8, client_version: String, }, BeginTask { task: String, }, CommitTask { run: String, }, FindBlob { digest: CacheDigest, }, FindBlobs { digests: Vec<CacheDigest>, }, StoreBlob { digest: CacheDigest, source: PathBuf, }, FindActionResult { action: CacheDigest, }, RecordActionHit { action: CacheDigest, restore: RestoreStats, crate_name: Option<String>, }, RecordBypass { kind: String, }, RecordUnconsulted, RecordCompilerInvocation { outcome: String, crate_name: Option<String>, duration_ns: u64, }, RecordActionVerification { matched: bool, restore: RestoreStats, }, StoreActionResult { result: RemoteActionResult, }, FindActionPrediction { task: String, invocation: CacheDigest, }, RecordActionPrediction { task: String, prediction: ActionPrediction, }, FindExecutableIdentity { executable: PathBuf, environment: BTreeMap<String, Option<String>>, }, StoreExecutableIdentity { executable: PathBuf, environment: BTreeMap<String, Option<String>>, stdout: Vec<u8>, pins: Vec<PinnedFile>, }, RecordWarning { message: String, }, FindFileDigests { scope: FileDigestScope, files: Vec<FileIdentity>, }, RecordFileDigests { scope: FileDigestScope, entries: Vec<RecordedFileDigest>, }, JoinActionPromise { adapter: String, invocation: CacheDigest, }, CompleteActionPromise { claim: String, prediction: ActionPrediction, }, ResolveFileDigests { scope: FileDigestScope, files: Vec<FileIdentity>, }, RecordWrapperTiming { timing: WrapperTiming, }, RecordError { message: String, }, RecordDebug { target: String, message: String, },
}
Expand description

A request accepted by the task-scoped cache agent.

Variants§

§

Hello

Negotiate protocol and application versions.

Fields

§protocol: u8

Agent protocol version understood by the caller.

§client_version: String

Human-readable mbx client version.

§

BeginTask

Begin a prediction-manifest run for a stable Cargo or task identity.

Fields

§task: String

Stable 64-character lowercase hexadecimal task identity.

§

CommitTask

Commit predictions collected by an earlier Self::BeginTask.

Fields

§run: String

Opaque run identifier returned by the agent.

§

FindBlob

Resolve a blob to a session-verified local CAS path.

Fields

§digest: CacheDigest

Blob to resolve.

§

FindBlobs

Resolve blobs to session-verified local CAS paths.

Fields

§digests: Vec<CacheDigest>

Blobs to resolve, preserving request order in the response.

§

StoreBlob

Import a file into the local content-addressed store.

Fields

§digest: CacheDigest

Digest the source must match.

§source: PathBuf

File to verify and import.

§

FindActionResult

Look up an action-result record.

Fields

§action: CacheDigest

Action digest to resolve.

§

RecordActionHit

Account for a successfully restored cache hit.

Fields

§action: CacheDigest

Action that supplied the outputs.

§restore: RestoreStats

Restoration work performed by the adapter.

§crate_name: Option<String>

Compiler crate name, when the invocation supplied one.

§

RecordBypass

A compilation the adapter declined to cache, grouped by reason.

Fields

§kind: String

Stable, low-cardinality bypass-reason name.

§

RecordUnconsulted

A compilation the adapter could not look up, having no key to look up with. Distinct from a bypass: these are cached once compiled.

§

RecordCompilerInvocation

Account for one real compiler invocation performed by the adapter.

Fields

§outcome: String

Stable outcome category such as miss, unconsulted, bypass, or incremental for a compilation the adapter deliberately ran with incremental state instead of publishing.

§crate_name: Option<String>

Compiler crate name, when the invocation supplied one.

§duration_ns: u64

Wall time spent running the compiler.

§

RecordActionVerification

Account for a cache hit that was rebuilt for correctness verification.

Fields

§matched: bool

Whether rebuilt and cached outputs matched.

§restore: RestoreStats

Restoration work performed before rebuilding.

§

StoreActionResult

Store an action-result record locally and enqueue remote publication.

Fields

§result: RemoteActionResult

Action-result record to store.

§

FindActionPrediction

Find an earlier input prediction for a task and invocation.

Fields

§task: String

Stable task identity.

§invocation: CacheDigest

Digest of the compiler invocation without discovered inputs.

§

RecordActionPrediction

Record an input prediction after a successful compilation.

Fields

§task: String

Stable task identity.

§prediction: ActionPrediction

Adapter-owned prediction record.

§

FindExecutableIdentity

Find cached identity output for an executable and environment.

Fields

§executable: PathBuf

Executable whose identity command would run.

§environment: BTreeMap<String, Option<String>>

Environment variables affecting identity output.

§

StoreExecutableIdentity

Cache identity output for an executable and environment.

Fields

§executable: PathBuf

Executable whose identity command ran.

§environment: BTreeMap<String, Option<String>>

Environment variables affecting identity output.

§stdout: Vec<u8>

Captured identity-command standard output.

§pins: Vec<PinnedFile>

Files the probe read, as they were when it read them, which pin the output beyond this session so the next one can skip the probe. Empty keeps the identity for this session only.

§

RecordWarning

Surface a shim diagnostic through the session that owns the build.

A shim must not print diagnostics itself: its stderr belongs to the compiler it stands in for, and build scripts read that stream as part of the compiler’s answer – cc-rs treats any stderr output from a flag probe as “unsupported”, which changes the flags of every compilation that follows and, with them, every action key the build produces.

Appended rather than grouped with the other Record* requests it belongs beside: these variants carry no repr, so inserting one moves the discriminant of every variant after it, and a break nobody asked for is worth less than the grouping.

Fields

§message: String

Human-readable single-line diagnostic.

§

FindFileDigests

Find session-recorded digests for files with these identities.

Fields

§scope: FileDigestScope

What the recorded digests may stand in for.

§files: Vec<FileIdentity>

File identities to resolve, preserving request order in the response.

§

RecordFileDigests

Record digests of files a shim hashed or wrote this session.

Fields

§scope: FileDigestScope

What the recorded digests may stand in for.

§entries: Vec<RecordedFileDigest>

Hashed files and the identities their digests describe.

§

JoinActionPromise

Join or claim an invocation-wide promise through the cache server.

Fields

§adapter: String

Adapter that owns the invocation and prediction payload.

§invocation: CacheDigest

Digest of the compiler invocation before input discovery.

§

CompleteActionPromise

Fulfill a claimed promise after its action result is remotely durable.

Fields

§claim: String

Opaque claim token returned by Self::JoinActionPromise.

§prediction: ActionPrediction

Prediction through which waiters reconstruct the final action key.

§

ResolveFileDigests

Resolve file digests, coalescing concurrent reads through the agent.

Fields

§scope: FileDigestScope

What the digest and any accompanying validation may stand in for.

§files: Vec<FileIdentity>

File identities to resolve, preserving request order.

§

RecordWrapperTiming

Record exclusive wrapper phase durations and bounded trace spans.

Fields

§timing: WrapperTiming

Completed invocation timings.

§

RecordError

Surface a fatal shim diagnostic through the session that owns the build.

This is appended to preserve every existing request variant and wire shape while allowing a caller to distinguish fatal acknowledgement from Self::RecordWarning and fall back locally when it is not accepted.

Fields

§message: String

Human-readable single-line diagnostic.

§

RecordDebug

Emit a routine shim log through the owning session’s logger. Filtering uses the original target; these records never consume the warning/error allowance or enter compiler output.

Fields

§target: String

Original logging module target.

§message: String

Human-readable single-line message.

Trait Implementations§

Source§

impl Clone for AgentRequest

Source§

fn clone(&self) -> AgentRequest

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 AgentRequest

Source§

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

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

impl<'de> Deserialize<'de> for AgentRequest

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for AgentRequest

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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