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, url::Url, 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§

source

fn into_client_request(self) -> Result<Request>

Convert into a Request that can be used for a client connection.

Implementations on Foreign Types§

source§

impl IntoClientRequest for Uri

source§

impl IntoClientRequest for Url

source§

impl IntoClientRequest for String

source§

impl<'a> IntoClientRequest for &'a str

source§

impl<'a> IntoClientRequest for &'a Uri

source§

impl<'a> IntoClientRequest for &'a Url

source§

impl<'a> IntoClientRequest for &'a String

source§

impl<'h, 'b> IntoClientRequest for Request<'h, 'b>

Implementors§

source§

impl IntoClientRequest for tungstenite::handshake::client::Request