[−][src]Struct websocket_lite::ClientBuilder
Establishes a WebSocket connection.
ws://...
and wss://...
URLs are supported.
Methods
impl ClientBuilder
[src]
impl ClientBuilder
pub fn new(url: &str) -> Result<Self, ParseError>
[src]
pub fn new(url: &str) -> Result<Self, ParseError>
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]
pub fn from_url(url: Url) -> Self
Creates a ClientBuilder
that connects to a given WebSocket URL.
This method never fails as the URL has already been parsed.
pub fn async_connect_insecure(
self
) -> impl Future<Item = AsyncClient<TcpStream>, Error = Error>
[src]
pub fn async_connect_insecure(
self
) -> impl Future<Item = AsyncClient<TcpStream>, Error = Error>
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]
pub fn connect_insecure(self) -> Result<Client<TcpStream>>
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 fn async_connect(
self
) -> impl Future<Item = AsyncClient<Box<dyn AsyncNetworkStream + Sync + Send + 'static>>, Error = Error>
[src]
pub fn async_connect(
self
) -> impl Future<Item = AsyncClient<Box<dyn AsyncNetworkStream + Sync + Send + 'static>>, Error = Error>
Establishes a connection to the WebSocket server.
pub fn connect(
self
) -> Result<Client<Box<dyn NetworkStream + Sync + Send + 'static>>>
[src]
pub fn connect(
self
) -> Result<Client<Box<dyn NetworkStream + Sync + Send + 'static>>>
Establishes a connection to the WebSocket server.
pub fn async_connect_on<S: AsyncRead + AsyncWrite>(
self,
stream: S
) -> impl Future<Item = AsyncClient<S>, Error = Error>
[src]
pub fn async_connect_on<S: AsyncRead + AsyncWrite>(
self,
stream: S
) -> impl Future<Item = AsyncClient<S>, Error = Error>
Takes over an already established stream and use 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]
pub fn connect_on<S: Read + Write>(self, stream: S) -> Result<Client<S>>
Takes over an already established stream and use 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 Send for ClientBuilder
impl Sync for ClientBuilder
impl Sync for ClientBuilder
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
impl<T> Erased for T
impl<T> Erased for T