pub struct ResponsesWebSocketSessionBuilder<H = Client> { /* private fields */ }Available on non-
target_family=wasm and crate feature websocket only.Expand description
A builder for an OpenAI Responses WebSocket session.
The default builder applies a 30 second connection timeout and leaves the per-event timeout disabled.
Implementations§
Source§impl<H> ResponsesWebSocketSessionBuilder<H>
impl<H> ResponsesWebSocketSessionBuilder<H>
Sourcepub fn connect_timeout(self, timeout: Duration) -> Self
pub fn connect_timeout(self, timeout: Duration) -> Self
Sets the timeout for establishing the websocket connection.
Sourcepub fn without_connect_timeout(self) -> Self
pub fn without_connect_timeout(self) -> Self
Disables the websocket connection timeout.
Sourcepub fn event_timeout(self, timeout: Duration) -> Self
pub fn event_timeout(self, timeout: Duration) -> Self
Sets the timeout for waiting on the next websocket event.
Sourcepub fn without_event_timeout(self) -> Self
pub fn without_event_timeout(self) -> Self
Disables the websocket event timeout.
Source§impl<H> ResponsesWebSocketSessionBuilder<H>
impl<H> ResponsesWebSocketSessionBuilder<H>
Sourcepub async fn connect(
self,
) -> Result<ResponsesWebSocketSession<H>, CompletionError>
pub async fn connect( self, ) -> Result<ResponsesWebSocketSession<H>, CompletionError>
Opens the websocket session using the configured builder options.
Auto Trait Implementations§
impl<H> Freeze for ResponsesWebSocketSessionBuilder<H>where
H: Freeze,
impl<H> RefUnwindSafe for ResponsesWebSocketSessionBuilder<H>where
H: RefUnwindSafe,
impl<H> Send for ResponsesWebSocketSessionBuilder<H>where
H: Send,
impl<H> Sync for ResponsesWebSocketSessionBuilder<H>where
H: Sync,
impl<H> Unpin for ResponsesWebSocketSessionBuilder<H>where
H: Unpin,
impl<H> UnsafeUnpin for ResponsesWebSocketSessionBuilder<H>where
H: UnsafeUnpin,
impl<H> UnwindSafe for ResponsesWebSocketSessionBuilder<H>where
H: UnwindSafe,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more