pub struct Context { /* private fields */ }Implementations§
Source§impl Context
impl Context
Sourcepub fn config_home(&self) -> Option<&Path>
pub fn config_home(&self) -> Option<&Path>
Where XDG Base Directory 0.8 puts this context’s configuration on macOS and Linux:
XDG_CONFIG_HOME where it names a full path, else .config in the home. None on
Windows.
Sourcepub fn data_home(&self) -> Option<&Path>
pub fn data_home(&self) -> Option<&Path>
The same for data: XDG_DATA_HOME, else .local/share in the home.
Sourcepub fn cache_home(&self) -> Option<&Path>
pub fn cache_home(&self) -> Option<&Path>
The same for what may be thrown away: XDG_CACHE_HOME, else .cache in the home.
Sourcepub fn with_codex_home(self, dir: String) -> Context
pub fn with_codex_home(self, dir: String) -> Context
Where Codex keeps its login. Empty means unset, as Codex reads it.
pub fn with_pitboard_home(self, dir: PathBuf) -> Context
Sourcepub fn schedule_program(&self) -> Option<&Path>
pub fn schedule_program(&self) -> Option<&Path>
The Pitboard the daily renewal schedule is written to run, where one was named.
Sourcepub fn started_by_the_schedule(self) -> Context
pub fn started_by_the_schedule(self) -> Context
Say this process is a run of the daily renewal schedule, as the marker its job is
started with says where what the system says of the job it started is not to be
relied on: the command line does this for pitboard renew --scheduled. Such a run
renews the default home whatever PITBOARD_HOME says
(crate::schedule::SCHEDULED_RUN).
Sourcepub fn started_by_the_watch_service(self) -> Context
pub fn started_by_the_watch_service(self) -> Context
The context a run of the watch service watches in, as the marker its job is started
with says: the command line does this for pitboard watch --scheduled. It watches the
default home whatever PITBOARD_HOME says, given the variables its job’s file keeps
where the system hands the job none, as a run of the renewal schedule renews.
Sourcepub fn for_command_line(env: &Environment) -> Context
pub fn for_command_line(env: &Environment) -> Context
The command line’s context, from the environment it was started with: a shell’s, so
each tool’s program is looked for on its PATH when it runs.