[−][src]Struct websocket_lite::ClientBuilder
Establishes a WebSocket connection.
ws://...
and wss://...
URLs are supported.
Methods
impl ClientBuilder
[src]
pub fn new(url: &str) -> Result<Self, ParseError>
[src]
Creates a ClientBuilder
that connects to a given WebSocket URL.
This method returns an Err
result if URL parsing fails.
pub fn from_url(url: Url) -> Self
[src]
Creates a ClientBuilder
that connects to a given WebSocket URL.
This method never fails as the URL has already been parsed.
pub async fn async_connect_insecure(self) -> Result<AsyncClient<TcpStream>>
[src]
Establishes a connection to the WebSocket server.
wss://...
URLs are not supported by this method. Use async_connect
if you need to be able to handle
both ws://...
and wss://...
URLs.
pub fn connect_insecure(self) -> Result<Client<TcpStream>>
[src]
Establishes a connection to the WebSocket server.
wss://...
URLs are not supported by this method. Use connect
if you need to be able to handle
both ws://...
and wss://...
URLs.
pub async fn async_connect(
self
) -> Result<AsyncClient<Box<dyn AsyncNetworkStream + Sync + Send + Unpin + 'static>>>
[src]
self
) -> Result<AsyncClient<Box<dyn AsyncNetworkStream + Sync + Send + Unpin + 'static>>>
Establishes a connection to the WebSocket server.
pub fn connect(
self
) -> Result<Client<Box<dyn NetworkStream + Sync + Send + 'static>>>
[src]
self
) -> Result<Client<Box<dyn NetworkStream + Sync + Send + 'static>>>
Establishes a connection to the WebSocket server.
pub async fn async_connect_on<S: AsyncRead + AsyncWrite + Unpin>(
self,
__arg1: S
) -> Result<AsyncClient<S>>
[src]
self,
__arg1: S
) -> Result<AsyncClient<S>>
Takes over an already established stream and uses it to send and receive WebSocket messages.
This method assumes that the TLS connection has already been established, if needed. It sends an HTTP
Connection: Upgrade
request and waits for an HTTP OK response before proceeding.
pub fn connect_on<S: Read + Write>(self, stream: S) -> Result<Client<S>>
[src]
Takes over an already established stream and uses it to send and receive WebSocket messages.
This method assumes that the TLS connection has already been established, if needed. It sends an HTTP
Connection: Upgrade
request and waits for an HTTP OK response before proceeding.
Auto Trait Implementations
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl UnwindSafe for ClientBuilder
impl RefUnwindSafe for ClientBuilder
Blanket Implementations
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> 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> 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,