[−][src]Struct websocket_lite::ClientBuilder
Establishes a WebSocket connection.
ws://... and wss://... URLs are supported.
Methods
impl ClientBuilder[src]
impl ClientBuilderpub 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) -> SelfCreates 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 = Client<TcpStream>, Error = Error>[src]
pub fn async_connect_insecure(
self
) -> impl Future<Item = Client<TcpStream>, Error = Error>Establish a connection to the WebSocket server.
pub fn async_connect(
self
) -> impl Future<Item = Client<Box<dyn AsyncNetworkStream + Sync + Send + 'static>>, Error = Error>[src]
pub fn async_connect(
self
) -> impl Future<Item = Client<Box<dyn AsyncNetworkStream + Sync + Send + 'static>>, Error = Error>Establish a connection to the WebSocket server.
pub fn async_connect_on<S: AsyncRead + AsyncWrite>(
self,
stream: S
) -> impl Future<Item = Client<S>, Error = Error>[src]
pub fn async_connect_on<S: AsyncRead + AsyncWrite>(
self,
stream: S
) -> impl Future<Item = Client<S>, Error = Error>Take 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 ClientBuilderimpl Sync for ClientBuilder
impl Sync for ClientBuilderBlanket Implementations
impl<T, U> Into for T where
U: From<T>, [src]
impl<T, U> Into for T where
U: From<T>, impl<T> From for T[src]
impl<T> From for Timpl<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>try_from)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized, [src]
impl<T> Borrow for T where
T: ?Sized, 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 TMutably borrows from an owned value. Read more
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>try_from)Performs the conversion.
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🔬 This is a nightly-only experimental API. (get_type_id)
this method will likely be replaced by an associated static
Gets the TypeId of self. Read more
impl<T> Erased for T
impl<T> Erased for T