pub struct Ctx<'a> {
pub workspace: &'a Path,
pub section_root: PathBuf,
pub cwd: Option<PathBuf>,
pub home: &'a Path,
pub level: LevelId,
}Expand description
The facts about the player’s situation that requirements, answers and cd rules
consult.
The engine never reads the process working directory, HOME or any environment
variable: the caller captures them once and hands them in here. That keeps every rule a
plain function of its inputs, so tests run in parallel without chdir or set_var.
Fields§
§workspace: &'a PathThe workspace root (holds level-N directories and the marker files).
section_root: PathBufThe absolute directory every path of the current level is relative to.
cwd: Option<PathBuf>The player’s current directory, already canonical, or None when it no longer
exists (the player deleted the directory they were standing in).
home: &'a PathThe logical $HOME.
level: LevelIdThe level being checked.
Implementations§
Source§impl<'a> Ctx<'a>
impl<'a> Ctx<'a>
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Ctx<'a>
impl<'a> RefUnwindSafe for Ctx<'a>
impl<'a> Send for Ctx<'a>
impl<'a> Sync for Ctx<'a>
impl<'a> Unpin for Ctx<'a>
impl<'a> UnsafeUnpin for Ctx<'a>
impl<'a> UnwindSafe for Ctx<'a>
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