pub struct PlaygroundGuard { /* private fields */ }Expand description
Guard that keeps real-mode lesson commands inside the playground.
Implementations§
Source§impl PlaygroundGuard
impl PlaygroundGuard
Sourcepub fn new(root: impl Into<PathBuf>) -> Self
pub fn new(root: impl Into<PathBuf>) -> Self
Create a guard for the given playground root (absolute path).
Sourcepub fn check(&self, command: &str, cwd: &Path) -> GuardVerdict
pub fn check(&self, command: &str, cwd: &Path) -> GuardVerdict
Check a command line before it is sent to the real shell.
cwd is the tracked working directory for the practice session; it
must be inside the playground root. The check is purely lexical — it
never touches the filesystem.
Auto Trait Implementations§
impl Freeze for PlaygroundGuard
impl RefUnwindSafe for PlaygroundGuard
impl Send for PlaygroundGuard
impl Sync for PlaygroundGuard
impl Unpin for PlaygroundGuard
impl UnsafeUnpin for PlaygroundGuard
impl UnwindSafe for PlaygroundGuard
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