pub fn execute_cargo(
invocation: &CargoInvocation,
policy: CargoExecutionPolicy,
spawn: impl FnMut(&mut Command) -> Result<OwnedChild>,
cancelled: impl FnMut() -> bool + Send,
output: impl FnMut(OutputStream, &[u8]) -> Result<()>,
message: impl FnMut(Message) -> Result<()>,
) -> Result<CargoExecution>Expand description
Observe tools, execute one rendered invocation, drain/decode it and recheck tools.
Source/configuration mutation guards and artifact lifetime remain caller-owned.
spawn selects process/group custody and may override stdio. It must execute
the supplied command without changing its recipe. Cancellation is also polled
during identity probes; probes have complete 64 KiB output bounds and no finite
default deadline. All raw build output reaches output, including failures.
ยงErrors
Returns pre-execution validation/probe failures or the original spawn error. Once spawned, process, protocol and revalidation evidence is returned together.