pub struct Execution { /* private fields */ }Expand description
A live execution of a codex exec --json subprocess.
Provides a read-only event stream. The codex process handles tool execution internally — there is no stdin interaction.
Implementations§
Source§impl Execution
impl Execution
Sourcepub async fn next_event(&mut self) -> Result<Option<Event>>
pub async fn next_event(&mut self) -> Result<Option<Event>>
Get the next event from the execution.
Returns Ok(None) when the execution is complete (subprocess exited).
§Errors
Returns an error on I/O failure, JSON parse failure, or if the subprocess dies unexpectedly.
Sourcepub fn thread_id(&self) -> Option<&str>
pub fn thread_id(&self) -> Option<&str>
Get the thread ID assigned by codex, if a thread.started event has
been received.
Sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Returns true if the execution has finished (subprocess exited or EOF).
Auto Trait Implementations§
impl Freeze for Execution
impl !RefUnwindSafe for Execution
impl Send for Execution
impl Sync for Execution
impl Unpin for Execution
impl UnsafeUnpin for Execution
impl !UnwindSafe for Execution
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