Skip to main content

CodexFacts

Struct CodexFacts 

Source
pub struct CodexFacts {
    pub home: PathBuf,
    pub present: bool,
    pub enrolled: usize,
    pub backend: &'static str,
    pub auth_file: PathBuf,
    pub auth_mode: Option<u32>,
    pub login: Result<Option<CodexLogin>, CodexLoginTrouble>,
    pub program: Option<PathBuf>,
    pub version: Option<String>,
    pub running: Option<Vec<u32>>,
}
Expand description

What is read about Codex CLI on this machine.

Read without running it and without touching a keychain item Codex created for itself: its home, its configuration, the one file it keeps its login in by default, and which codex processes are running.

Fields§

§home: PathBuf

CODEX_HOME, or ~/.codex.

§present: bool

Whether that directory exists. It does once Codex has been run here, and not before.

§enrolled: usize

How many Codex accounts pitboard has enrolled.

§backend: &'static str

Where Codex is configured to keep its login, in Codex’s own words: cli_auth_credentials_store’s file, keyring, auto or ephemeral, or secrets for a keychain store with [features] secret_auth_storage, which Codex has no one word for.

§auth_file: PathBuf

Where the default store keeps it.

§auth_mode: Option<u32>

That file’s mode, where there is such a file.

§login: Result<Option<CodexLogin>, CodexLoginTrouble>

Whose login the file holds, or why that could not be told. Ok(None) for no file, and for a store pitboard does not read.

§program: Option<PathBuf>

Where the codex pitboard would run is, where it is anywhere.

§version: Option<String>

Which Codex that is, read off the path it is installed at. None both where there is no codex and where its path does not say; CodexFacts::program tells which.

§running: Option<Vec<u32>>

Every codex running as this user, by pid. None where that could not be asked.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.