Expand description
Subprocess execution with logging.
Ported from internal/executor/exec.go, internal/executor/client.go,
internal/executor/interface.go, and internal/executor/context.go.
Real subprocess execution uses tokio::process::Command internally,
bridged from the synchronous CommandRunner trait via a lazily
started background tokio::runtime::Runtime (see runtime).
Cancellation/timeouts race the child’s wait() against
tokio::time::sleep with tokio::select!, killing the child with
Child::kill() on timeout — see PORT_NOTES.md for the full
architecture write-up and its known limitations.
Re-exports§
pub use context::ErrRunnerMissing;pub use context::from_context;pub use context::with_context;pub use noop::NoopClient;pub use repository::RepositoryExecutorDecorator;pub use repository::get_repository_decorators;pub use streamed::ExecStreamedOpts;
Modules§
- context
- Attaching a
super::CommandRunnerto an ambient execution context. - mise_
decorator - Wraps commands with
mise exec --whenmiseis available in PATH. - noop
- A
CommandRunnerthat refuses to execute any command. - repository
- Decorators applied to commands executed within a repository directory.
- streamed
- Streaming command execution (TTY scrolling area / prefixed lines / logger fallback).
Structs§
- Client
- Ported from
Clientinclient.go. - Exec
Result - Ported from
Resultinexec.go. Renamed to avoid shadowingstd::result::Result. - Options
- Ported from
Optionsinexec.go.
Enums§
- Exec
Error - Errors ported from the sentinel
errors.New/fmt.Errorfvalues inexec.go.
Traits§
- Command
Runner - Ported from the
CommandRunnerinterface ininterface.go.
Functions§
- apply_
sudo - Ported from
ApplySudo, wired to the real environment. - apply_
sudo_ with - Ported from
ApplySudo. Go stubsgeteuid/lookPathas reassignable package-level vars for testing; Rust has no equivalent to mutable top-level function pointers withoutunsafeglobal state, so this port takes the euid getter and PATH lookup as explicit parameters instead. The zero-argumentapply_sudobelow is the production entry point, wiring in a realgeteuid(2)call andlook_path; ported tests callapply_sudo_withdirectly. SeePORT_NOTES.md. - check
- Ported from the package-level
checkfunction, with no deadline. Seecheck_with_timeoutfor the deviation that threads one through explicitly (Go’s version takes a deadline via the ambientcontext.Contextargument every caller already has). - check_
with_ timeout - Ported from the package-level
checkfunction. SeePORT_NOTES.md: this crate has no ambient context to carry Go’s caller-supplied deadline, sotimeoutis threaded through explicitly as a disclosed deviation from a literal 1:1 signature match. - look_
path - Ported from
lookPath(aliased toexec.LookPathin Go). Minimal manual$PATHsearch, matchingmise_decorator’s existing approach of avoiding a dependency on an externalwhich-style crate for this narrow use. - read_
stdout - Ported from the package-level
readStdoutfunction. - run
- Ported from the package-level
runfunction. - run_
sudo - Ported from
runSudo, wired to the real environment viaapply_sudo. - run_
sudo_ with - Ported from
runSudo. Seeapply_sudo_with’s doc comment: this port takes the euid getter and PATH lookup as explicit parameters (rather than Go’s reassignable package-levelvars) so tests can stub them without touching real root privileges or the realsudobinary. Runs synchronously with inherited stdio (std::process::Command), matching Go’srunSudo, which deliberately does not capture output sosudocan prompt on the controlling terminal.
Type Aliases§
- LogLevel
- Log level for streamed/buffered output. Ported from
slog.Levelusage inOptions; this crate usestracing::Levelas the idiomatic Rust equivalent of Go’slog/slog(seePORT_NOTES.md).