pub struct SessionOptions {
pub client_info: ClientInfo,
pub capabilities: Option<InitializeCapabilities>,
pub command: String,
pub extra_args: Vec<String>,
pub call_timeout: Option<Duration>,
pub events_capacity: Option<usize>,
}Expand description
Options used when creating a high-level CodexSession.
This wraps the generated initialize params plus process-spawn knobs so a
caller can connect, handshake, and start using the app-server in one call.
Fields§
§client_info: ClientInfo§capabilities: Option<InitializeCapabilities>§command: String§extra_args: Vec<String>§call_timeout: Option<Duration>§events_capacity: Option<usize>Implementations§
Source§impl SessionOptions
impl SessionOptions
Sourcepub fn new(name: impl Into<String>, version: impl Into<String>) -> Self
pub fn new(name: impl Into<String>, version: impl Into<String>) -> Self
Creates default session options for a client name and version.
Sourcepub fn with_title(self, title: impl Into<String>) -> Self
pub fn with_title(self, title: impl Into<String>) -> Self
Adds a human-readable title to the initialize client info.
Sourcepub fn with_command(self, command: impl Into<String>) -> Self
pub fn with_command(self, command: impl Into<String>) -> Self
Uses a different binary than codex when spawning the app-server.
Sourcepub fn with_extra_arg(self, arg: impl Into<String>) -> Self
pub fn with_extra_arg(self, arg: impl Into<String>) -> Self
Appends one extra argument after app-server when spawning Codex.
Sourcepub fn with_config(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_config( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Appends a Codex -c key=value config override.
Sourcepub fn with_capabilities(self, capabilities: InitializeCapabilities) -> Self
pub fn with_capabilities(self, capabilities: InitializeCapabilities) -> Self
Supplies explicit initialize capabilities.
Sourcepub fn with_call_timeout(self, timeout: Duration) -> Self
pub fn with_call_timeout(self, timeout: Duration) -> Self
Overrides the request/response timeout used by generated client calls.
Sourcepub fn with_events_capacity(self, events_capacity: usize) -> Self
pub fn with_events_capacity(self, events_capacity: usize) -> Self
Overrides the capacity of the session’s internal event channel
instead of crate::DEFAULT_EVENTS_CHANNEL_CAPACITY. See
crate::CodexAppServerClient::spawn_with_events_capacity for what
this bounds and the drop policy once it fills up. A 0 capacity is
rejected (not silently clamped) by the underlying client constructor
when the session is created.
Trait Implementations§
Source§impl Clone for SessionOptions
impl Clone for SessionOptions
Source§fn clone(&self) -> SessionOptions
fn clone(&self) -> SessionOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more