[−][src]Struct embedded_websocket::WebSocketOptions
Websocket options used by a websocket client to initiate an opening handshake with a websocket server
Fields
path: &'a str
The request uri (e.g. /chat?id=123
) of the GET method used to identify the endpoint of the
websocket connection. This allows multiple domains to be served by a single server.
This could also be used to send identifiable information about the client
host: &'a str
The hostname (e.g. server.example.com
) is used so that both the client and the server
can verify that they agree on which host is in use
origin: &'a str
The origin (e.g. http://example.com
) is used to protect against unauthorized
cross-origin use of a WebSocket server by scripts using the WebSocket API in a web
browser. This field is usually only set by browser clients but servers may require it
so it has been exposed here.
sub_protocols: Option<&'a [&'a str]>
A list of requested sub protocols in order of preference. The server should return the first sub protocol it supports or none at all. A sub protocol can be anything agreed between the server and client
additional_headers: Option<&'a [&'a str]>
Any additional headers the server may require that are not part of the websocket
spec. These should be fully formed http headers without the \r\n
(e.g. MyHeader: foo
)
Auto Trait Implementations
impl<'a> Send for WebSocketOptions<'a>
impl<'a> Sync for WebSocketOptions<'a>
Blanket Implementations
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self