pub struct Guard { /* private fields */ }Expand description
What decides whether a launch may proceed. Build one with Guard::for_workspace (apps) or
Guard::for_temp_roots (engines without a workspace).
Implementations§
Source§impl Guard
impl Guard
Sourcepub fn for_temp_roots(app: Option<&str>) -> Guard
pub fn for_temp_roots(app: Option<&str>) -> Guard
Guard for an engine or any launch without a workspace: paths must sit in a system temp root and break no forbidden-location rule.
Sourcepub fn for_workspace(ws: &QaWorkspace) -> Result<Guard, UserDataViolation>
pub fn for_workspace(ws: &QaWorkspace) -> Result<Guard, UserDataViolation>
Guard for an app launched in ws. Fails when the home is not a QA root this runner created
or is itself in a forbidden location.
Sourcepub fn with_user_homes(self, homes: Vec<PathBuf>) -> Guard
pub fn with_user_homes(self, homes: Vec<PathBuf>) -> Guard
Replace the user homes the guard protects (default: HOME and USERPROFILE of this
process). Tests point it at a fake home.
Sourcepub fn with_app(self, app: &str) -> Guard
pub fn with_app(self, app: &str) -> Guard
Name the app under test; its real data directories become forbidden.
Sourcepub fn forbidden(&self, resolved: &Path) -> Option<(Rule, String)>
pub fn forbidden(&self, resolved: &Path) -> Option<(Rule, String)>
First forbidden-location rule resolved breaks, ignoring any QA root.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Guard
impl RefUnwindSafe for Guard
impl Send for Guard
impl Sync for Guard
impl Unpin for Guard
impl UnsafeUnpin for Guard
impl UnwindSafe for Guard
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