pub struct Context {
pub dry_run: bool,
pub job_id: String,
pub working_dir: PathBuf,
}Expand description
Context provided to capabilities during execution.
Carries execution metadata such as dry-run mode, the owning job ID, and the working directory for relative path resolution.
Use Context::new to create instances — this ensures consistent
field initialization across CLI, executor, and daemon code paths.
Fields§
§dry_run: boolIf true, the capability should not perform side effects.
job_id: StringThe job ID that owns this execution.
working_dir: PathBufWorking directory for relative path resolution.
Implementations§
Source§impl Context
impl Context
Sourcepub fn new(dry_run: bool, job_id: String) -> Self
pub fn new(dry_run: bool, job_id: String) -> Self
Creates a new execution context.
Uses std::env::current_dir() as the default working directory.
The caller should override working_dir if an explicit directory
is known (e.g., from daemon dispatch parameters).
Sourcepub fn with_working_dir(
dry_run: bool,
job_id: String,
working_dir: PathBuf,
) -> Self
pub fn with_working_dir( dry_run: bool, job_id: String, working_dir: PathBuf, ) -> Self
Creates a new execution context with an explicit working directory.
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnsafeUnpin for Context
impl UnwindSafe for Context
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