Skip to main content

SessionOptions

Struct SessionOptions 

Source
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

Source

pub fn new(name: impl Into<String>, version: impl Into<String>) -> Self

Creates default session options for a client name and version.

Source

pub fn with_title(self, title: impl Into<String>) -> Self

Adds a human-readable title to the initialize client info.

Source

pub fn with_command(self, command: impl Into<String>) -> Self

Uses a different binary than codex when spawning the app-server.

Source

pub fn with_extra_arg(self, arg: impl Into<String>) -> Self

Appends one extra argument after app-server when spawning Codex.

Source

pub fn with_config( self, key: impl Into<String>, value: impl Into<String>, ) -> Self

Appends a Codex -c key=value config override.

Source

pub fn with_capabilities(self, capabilities: InitializeCapabilities) -> Self

Supplies explicit initialize capabilities.

Source

pub fn with_call_timeout(self, timeout: Duration) -> Self

Overrides the request/response timeout used by generated client calls.

Source

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

Source§

fn clone(&self) -> SessionOptions

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SessionOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more