pub struct WebSocketRequestBuilder { /* private fields */ }Expand description
Wrapper for RequestBuilder that performs the
websocket handshake when sent.
Implementations§
source§impl WebSocketRequestBuilder
impl WebSocketRequestBuilder
sourcepub fn protocols(self, protocols: Vec<String>) -> Self
pub fn protocols(self, protocols: Vec<String>) -> Self
Sets the websocket subprotocols to request.
sourcepub fn headers(self, headers: HeaderMap) -> Self
pub fn headers(self, headers: HeaderMap) -> Self
Add a set of Headers to the existing ones on this Request.
The headers will be merged in to any already set.
sourcepub fn max_frame_size(self, max_frame_size: usize) -> Self
pub fn max_frame_size(self, max_frame_size: usize) -> Self
Sets the websocket max_frame_size configuration.
sourcepub fn write_buffer_size(self, write_buffer_size: usize) -> Self
pub fn write_buffer_size(self, write_buffer_size: usize) -> Self
Sets the websocket write_buffer_size configuration.
sourcepub fn max_write_buffer_size(self, max_write_buffer_size: usize) -> Self
pub fn max_write_buffer_size(self, max_write_buffer_size: usize) -> Self
Sets the websocket max_write_buffer_size configuration.
sourcepub fn max_message_size(self, max_message_size: usize) -> Self
pub fn max_message_size(self, max_message_size: usize) -> Self
Sets the websocket max_message_size configuration.
sourcepub fn accept_unmasked_frames(self, accept_unmasked_frames: bool) -> Self
pub fn accept_unmasked_frames(self, accept_unmasked_frames: bool) -> Self
Sets the websocket accept_unmasked_frames configuration.
sourcepub async fn send(self) -> Result<WebSocketResponse, Error>
pub async fn send(self) -> Result<WebSocketResponse, Error>
Sends the request and returns and WebSocketResponse.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for WebSocketRequestBuilder
impl !RefUnwindSafe for WebSocketRequestBuilder
impl Send for WebSocketRequestBuilder
impl Sync for WebSocketRequestBuilder
impl Unpin for WebSocketRequestBuilder
impl !UnwindSafe for WebSocketRequestBuilder
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> 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