Add `guest_mount_path()` and `local_mount_path()` methods to `StagedLinuxRustPayloadRole`
Intent: Centralize the definition of guest and local mount paths on the enum that already represents the payload role, so that every call site derives paths from a single source of truth instead of duplicating string literals or path-join logic.
Affected files: crates/pikaci/src/model.rs
@@ -188,6 +188,19 @@ impl StagedLinuxRustPayloadRole {
+ pub fn guest_mount_path(self) -> &'static str {
+ match self {
+ Self::WorkspaceDeps => "/staged/linux-rust/workspace-deps",
+ Self::WorkspaceBuild => "/staged/linux-rust/workspace-build",
+ }
+ }
+
+ pub fn local_mount_path(self, job_dir: &Path) -> PathBuf {
+ job_dir
+ .join("staged-linux-rust")
+ .join(self.mount_dir_name())
+ }
Two methods are added to StagedLinuxRustPayloadRole in crates/pikaci/src/model.rs:191-202.
guest_mount_path(self) returns the static in-VM mount path (/staged/linux-rust/workspace-deps or /staged/linux-rust/workspace-build) that was previously defined as module-level constants in executor.rs.
local_mount_path(self, job_dir: &Path) constructs the host-side path by joining job_dir with staged-linux-rust and the role's mount_dir_name(). This path assembly was previously done inline in run.rs.