Struct ratchet_core::WebSocketResponse
source · pub struct WebSocketResponse { /* private fields */ }
Expand description
A response to send to a client if the connection will not be upgraded.
Implementations§
source§impl WebSocketResponse
impl WebSocketResponse
sourcepub fn new(code: u16) -> Result<WebSocketResponse, InvalidStatusCode>
pub fn new(code: u16) -> Result<WebSocketResponse, InvalidStatusCode>
Attempt to construct a new WebSocketResponse
from code
.
§Errors
Errors if the status code is invalid.
sourcepub fn with_headers<I>(
code: u16,
headers: I,
) -> Result<WebSocketResponse, InvalidStatusCode>
pub fn with_headers<I>( code: u16, headers: I, ) -> Result<WebSocketResponse, InvalidStatusCode>
Attempt to construct a new WebSocketResponse
from code
and `headers.
§Errors
Errors if the status code is invalid.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WebSocketResponse
impl RefUnwindSafe for WebSocketResponse
impl Send for WebSocketResponse
impl Sync for WebSocketResponse
impl Unpin for WebSocketResponse
impl UnwindSafe for WebSocketResponse
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> 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