pub struct ExtContext {
pub cli: Cli,
pub manager: Arc<ProcessManager>,
pub cwd: PathBuf,
}Expand description
Embedding context for cargo-e: CLI, process manager, and discovery directory.
Fields§
§cli: CliParsed CLI options (same flags as the cargo-e binary)
manager: Arc<ProcessManager>Shared process manager for plugin in-process execution
cwd: PathBufWorking directory used for scanning plugins
Implementations§
Source§impl ExtContext
impl ExtContext
Sourcepub fn new(cli: Cli, manager: Arc<ProcessManager>) -> Result<Self>
pub fn new(cli: Cli, manager: Arc<ProcessManager>) -> Result<Self>
Create a new embedding context with a CLI and ProcessManager. Does not perform any target collection yet. Create a new ExtContext; plugin loading is deferred until first use.
Sourcepub fn collect_targets(&self) -> Result<Vec<CargoTarget>>
pub fn collect_targets(&self) -> Result<Vec<CargoTarget>>
Collect all targets: built-in examples/binaries/tests/benches and plugin targets. Deduplicates by (name, kind, extended).
Sourcepub fn run_target(&self, target: &CargoTarget) -> Result<Option<ExitStatus>>
pub fn run_target(&self, target: &CargoTarget) -> Result<Option<ExitStatus>>
Run a target (example, binary, or plugin-provided) using the shared ProcessManager. Returns Ok(Some(status)) for built-in runs, or Ok(None) if no action was taken.
Auto Trait Implementations§
impl Freeze for ExtContext
impl !RefUnwindSafe for ExtContext
impl Send for ExtContext
impl Sync for ExtContext
impl Unpin for ExtContext
impl !UnwindSafe for ExtContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more