pub fn uri_mode(uri: &Uri) -> Result<Mode> {
    match uri.scheme_str() {
        Some("ws") => Ok(Mode::Plain),
        Some("wss") => Ok(Mode::Tls),
        _ => Err(Error::Url(UrlError::UnsupportedUrlScheme)),
    }
}
/// Get the mode of the given URL.
///
/// This function may be used to ease the creation of custom TLS streams
/// in non-blocking algorithms or for use with TLS libraries other than `native_tls` or `rustls`.
Get the mode of the given URL.
This function may be used to ease the creation of custom TLS streams
in non-blocking algorithms or for use with TLS libraries other than `native_tls` or `rustls`.
Get the mode of the given URL . This function may be used to ease the creation of custom TLS streams in non - blocking algorithms or for use with TLS libraries other than ` native_tls ` or ` rustls ` .
pub fn uri_mode(uri: &Uri) -> Result<Mode> {
    match uri.scheme_str() {
        Some("ws") => Ok(Mode::Plain),
        Some("wss") => Ok(Mode::Tls),
        _ => Err(Error::Url(UrlError::UnsupportedUrlScheme)),
    }
}
pub fn uri_mode ( uri : & Uri ) -> Result < Mode > { match uri . scheme_str ( ) { Some ( " " ) => Ok ( Mode :: Plain ) , Some ( " " ) => Ok ( Mode :: Tls ) , _ => Err ( Error :: Url ( UrlError :: UnsupportedUrlScheme ) ) , } }
Get the mode of the given URL.
Get the mode of the given URL .
uri
&Uri
uri
&Uri