Struct rust_engineio::asynchronous::ClientBuilder
source · pub struct ClientBuilder { /* private fields */ }
Implementations§
source§impl ClientBuilder
impl ClientBuilder
pub fn new(url: Url) -> Self
sourcepub fn tls_config(self, tls_config: TlsConnector) -> Self
pub fn tls_config(self, tls_config: TlsConnector) -> Self
Specify transport’s tls config
sourcepub fn on_close<T>(self, callback: T) -> Selfwhere
T: 'static + Send + Sync + Fn(()) -> BoxFuture<'static, ()>,
pub fn on_close<T>(self, callback: T) -> Selfwhere
T: 'static + Send + Sync + Fn(()) -> BoxFuture<'static, ()>,
Registers the on_close
callback.
sourcepub fn on_data<T>(self, callback: T) -> Selfwhere
T: 'static + Send + Sync + Fn(Bytes) -> BoxFuture<'static, ()>,
pub fn on_data<T>(self, callback: T) -> Selfwhere
T: 'static + Send + Sync + Fn(Bytes) -> BoxFuture<'static, ()>,
Registers the on_data
callback.
sourcepub fn on_error<T>(self, callback: T) -> Selfwhere
T: 'static + Send + Sync + Fn(String) -> BoxFuture<'static, ()>,
pub fn on_error<T>(self, callback: T) -> Selfwhere
T: 'static + Send + Sync + Fn(String) -> BoxFuture<'static, ()>,
Registers the on_error
callback.
sourcepub fn on_open<T>(self, callback: T) -> Selfwhere
T: 'static + Send + Sync + Fn(()) -> BoxFuture<'static, ()>,
pub fn on_open<T>(self, callback: T) -> Selfwhere
T: 'static + Send + Sync + Fn(()) -> BoxFuture<'static, ()>,
Registers the on_open
callback.
sourcepub fn on_packet<T>(self, callback: T) -> Selfwhere
T: 'static + Send + Sync + Fn(Packet) -> BoxFuture<'static, ()>,
pub fn on_packet<T>(self, callback: T) -> Selfwhere
T: 'static + Send + Sync + Fn(Packet) -> BoxFuture<'static, ()>,
Registers the on_packet
callback.
sourcepub async fn build(self) -> Result<Client, Error>
pub async fn build(self) -> Result<Client, Error>
Build websocket if allowed, if not fall back to polling
sourcepub async fn build_polling(self) -> Result<Client, Error>
pub async fn build_polling(self) -> Result<Client, Error>
Build socket with polling transport
sourcepub async fn build_websocket_with_upgrade(self) -> Result<Client, Error>
pub async fn build_websocket_with_upgrade(self) -> Result<Client, Error>
Build socket with a polling transport then upgrade to websocket transport
sourcepub async fn build_websocket(self) -> Result<Client, Error>
pub async fn build_websocket(self) -> Result<Client, Error>
Build socket with only a websocket transport
sourcepub async fn build_with_fallback(self) -> Result<Client, Error>
pub async fn build_with_fallback(self) -> Result<Client, Error>
Build websocket if allowed, if not allowed or errored fall back to polling. WARNING: websocket errors suppressed, no indication of websocket success or failure.
Trait Implementations§
source§impl Clone for ClientBuilder
impl Clone for ClientBuilder
source§fn clone(&self) -> ClientBuilder
fn clone(&self) -> ClientBuilder
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more