Trait tungstenite::client::IntoClientRequest
source · pub trait IntoClientRequest {
// Required method
fn into_client_request(self) -> Result<Request>;
}
Expand description
Trait for converting various types into HTTP requests used for a client connection.
This trait is implemented by default for string slices, strings, http::Uri
and
http::Request<()>
. Note that the implementation for http::Request<()>
is trivial and will
simply take your request and pass it as is further without altering any headers or URLs, so
be aware of this. If you just want to connect to the endpoint with a certain URL, better pass
a regular string containing the URL in which case tungstenite-rs
will take care for generating
the proper http::Request<()>
for you.
Required Methods§
sourcefn into_client_request(self) -> Result<Request>
fn into_client_request(self) -> Result<Request>
Convert into a Request
that can be used for a client connection.