pub struct CodexClient {
pub cli_path: String,
}Expand description
Builder / factory for codex executions.
Holds configuration that applies to every execution, such as the path
to the codex binary.
Fields§
§cli_path: StringPath to the codex CLI binary.
Implementations§
Source§impl CodexClient
impl CodexClient
Sourcepub fn with_cli_path(path: impl Into<String>) -> Self
pub fn with_cli_path(path: impl Into<String>) -> Self
Create a new client with a custom path to the codex CLI binary.
Sourcepub async fn exec(&self, prompt: &str, opts: ExecOptions) -> Result<Execution>
pub async fn exec(&self, prompt: &str, opts: ExecOptions) -> Result<Execution>
Start a new codex execution with the given prompt and options.
This spawns the codex exec --json subprocess and returns an
Execution handle for reading events.
§Errors
Returns SdkError::ProcessSpawn
if the codex binary cannot be found or started.
Sourcepub async fn exec_resume(
&self,
prompt: &str,
opts: ResumeOptions,
) -> Result<Execution>
pub async fn exec_resume( &self, prompt: &str, opts: ResumeOptions, ) -> Result<Execution>
Resume a previous codex execution.
§Errors
Returns SdkError::ProcessSpawn
if the codex binary cannot be found or started.
Trait Implementations§
Source§impl Clone for CodexClient
impl Clone for CodexClient
Source§fn clone(&self) -> CodexClient
fn clone(&self) -> CodexClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CodexClient
impl Debug for CodexClient
Auto Trait Implementations§
impl Freeze for CodexClient
impl RefUnwindSafe for CodexClient
impl Send for CodexClient
impl Sync for CodexClient
impl Unpin for CodexClient
impl UnsafeUnpin for CodexClient
impl UnwindSafe for CodexClient
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