Skip to main content

RestRouterOptions

Struct RestRouterOptions 

Source
pub struct RestRouterOptions {
    pub enable_text_turn_route: bool,
    pub enable_bridge_routes: bool,
    pub allow_unsafe_client_options: bool,
    pub limits: RestLimits,
}
Expand description

REST router behavior knobs.

Default is intentionally non-executing: only health and compatibility are mounted. Enable the text-turn helper or raw bridge routes explicitly when the caller mounts the router behind its own authz boundary.

Fields§

§enable_text_turn_route: bool§enable_bridge_routes: bool§allow_unsafe_client_options: bool§limits: RestLimits

Implementations§

Source§

impl RestRouterOptions

Source

pub fn text_turn() -> Self

Enables the one-shot text-turn helper without raw callable/session routes.

Source

pub fn trusted_bridge() -> Self

Enables the full raw callable bridge for trusted deployments.

Source

pub fn with_unsafe_client_options(self, allow: bool) -> Self

Allows request bodies to override the Codex command, extra arguments, and app-server config. This is intentionally separate from Self::trusted_bridge: admitting a caller to the bridge is not the same as allowing that caller to choose host executables or weaken sandboxing.

Source

pub fn with_max_sessions(self, max_sessions: usize) -> Self

Source

pub fn with_max_poll_timeout_ms(self, timeout_ms: u64) -> Self

Source

pub fn with_max_text_turn_duration_ms(self, timeout_ms: u64) -> Self

Source

pub fn with_max_text_turn_output_bytes(self, max_bytes: usize) -> Self

Source

pub fn with_sse_keep_alive_interval_ms(self, interval_ms: u64) -> Self

Sets the interval between SSE keep-alive frames on GET /v1/sessions/{sessionId}/events/stream. See RestLimits::sse_keep_alive_interval.

Source

pub fn with_limits(self, limits: RestLimits) -> Self

Replaces the whole RestLimits set in one call, e.g. with RestLimits::from_env or RestLimits::try_from_env:

let options = RestRouterOptions::trusted_bridge().with_limits(RestLimits::from_env());

Trait Implementations§

Source§

impl Clone for RestRouterOptions

Source§

fn clone(&self) -> RestRouterOptions

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 RestRouterOptions

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for RestRouterOptions

Source§

fn default() -> RestRouterOptions

Returns the “default value” for a type. 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