pub struct CodexBuilder { /* private fields */ }Expand description
Builder for creating a Codex client.
All options are optional. By default the builder discovers the codex
binary via PATH.
Implementations§
Source§impl CodexBuilder
impl CodexBuilder
Sourcepub fn binary(self, path: impl Into<PathBuf>) -> Self
pub fn binary(self, path: impl Into<PathBuf>) -> Self
Set an explicit path to the codex binary (skips PATH lookup).
Sourcepub fn working_dir(self, path: impl Into<PathBuf>) -> Self
pub fn working_dir(self, path: impl Into<PathBuf>) -> Self
Set the working directory for all commands.
Sourcepub fn env(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn env(self, key: impl Into<String>, value: impl Into<String>) -> Self
Set a single environment variable for child processes.
Sourcepub fn envs(
self,
vars: impl IntoIterator<Item = (impl Into<String>, impl Into<String>)>,
) -> Self
pub fn envs( self, vars: impl IntoIterator<Item = (impl Into<String>, impl Into<String>)>, ) -> Self
Set multiple environment variables for child processes.
Sourcepub fn timeout_secs(self, seconds: u64) -> Self
pub fn timeout_secs(self, seconds: u64) -> Self
Set the command timeout in seconds.
Sourcepub fn arg(self, arg: impl Into<String>) -> Self
pub fn arg(self, arg: impl Into<String>) -> Self
Append a raw global argument passed before any subcommand.
Sourcepub fn config(self, key_value: impl Into<String>) -> Self
pub fn config(self, key_value: impl Into<String>) -> Self
Add a global config override (-c key=value).
Sourcepub fn enable(self, feature: impl Into<String>) -> Self
pub fn enable(self, feature: impl Into<String>) -> Self
Enable a feature flag globally (--enable <name>).
Sourcepub fn disable(self, feature: impl Into<String>) -> Self
pub fn disable(self, feature: impl Into<String>) -> Self
Disable a feature flag globally (--disable <name>).
Sourcepub fn retry(self, policy: RetryPolicy) -> Self
pub fn retry(self, policy: RetryPolicy) -> Self
Set a default RetryPolicy for all commands.
Trait Implementations§
Source§impl Debug for CodexBuilder
impl Debug for CodexBuilder
Source§impl Default for CodexBuilder
impl Default for CodexBuilder
Source§fn default() -> CodexBuilder
fn default() -> CodexBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CodexBuilder
impl RefUnwindSafe for CodexBuilder
impl Send for CodexBuilder
impl Sync for CodexBuilder
impl Unpin for CodexBuilder
impl UnsafeUnpin for CodexBuilder
impl UnwindSafe for CodexBuilder
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