pub struct ResponsesWebSocketSessionBuilder { /* private fields */ }Available on 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 ResponsesWebSocketSessionBuilder
impl ResponsesWebSocketSessionBuilder
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 ResponsesWebSocketSessionBuilder
impl ResponsesWebSocketSessionBuilder
Sourcepub async fn connect(self) -> Result<ResponsesWebSocketSession, ProviderError>
Available on crate feature tungstenite only.
pub async fn connect(self) -> Result<ResponsesWebSocketSession, ProviderError>
tungstenite only.Open a session over the bundled tungstenite backend with the configured timeouts. Return handshake construction, transport, or provider errors.
Sourcepub async fn connect_with<W>(
self,
backend: &W,
) -> Result<ResponsesWebSocketSession, ProviderError>where
W: WebSocketClientExt,
pub async fn connect_with<W>(
self,
backend: &W,
) -> Result<ResponsesWebSocketSession, ProviderError>where
W: WebSocketClientExt,
Open a session over backend with the configured timeouts.
Return handshake construction, transport, or provider errors.
Auto Trait Implementations§
impl Freeze for ResponsesWebSocketSessionBuilder
impl RefUnwindSafe for ResponsesWebSocketSessionBuilder
impl Send for ResponsesWebSocketSessionBuilder
impl Sync for ResponsesWebSocketSessionBuilder
impl Unpin for ResponsesWebSocketSessionBuilder
impl UnsafeUnpin for ResponsesWebSocketSessionBuilder
impl UnwindSafe for ResponsesWebSocketSessionBuilder
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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