pub struct WsConfig { /* private fields */ }
Expand description
A Websocket transport.
Implementations§
Source§impl WsConfig
impl WsConfig
Sourcepub fn new_with_dns() -> Self
pub fn new_with_dns() -> Self
Create a new websocket transport based on the dns transport.
Sourcepub fn max_redirects(&self) -> u8
pub fn max_redirects(&self) -> u8
Return the configured maximum number of redirects.
Sourcepub fn set_max_redirects(&mut self, max: u8) -> &mut Self
pub fn set_max_redirects(&mut self, max: u8) -> &mut Self
Set max. number of redirects to follow.
Sourcepub fn max_data_size(&self) -> usize
pub fn max_data_size(&self) -> usize
Get the max. frame data size we support.
Sourcepub fn set_max_data_size(&mut self, size: usize) -> &mut Self
pub fn set_max_data_size(&mut self, size: usize) -> &mut Self
Set the max. frame data size we support.
Sourcepub fn set_tls_config(&mut self, c: Config) -> &mut Self
pub fn set_tls_config(&mut self, c: Config) -> &mut Self
Set the TLS configuration if TLS support is desired.
Sourcepub fn use_deflate(&mut self, flag: bool) -> &mut Self
pub fn use_deflate(&mut self, flag: bool) -> &mut Self
Should the deflate extension (RFC 7692) be used if supported?
Trait Implementations§
Source§impl Transport for WsConfig
impl Transport for WsConfig
Source§type Output = Connection<EitherOutput<EitherOutput<TlsClientStream<TcpTransStream>, TlsServerStream<TcpTransStream>>, TcpTransStream>>
type Output = Connection<EitherOutput<EitherOutput<TlsClientStream<TcpTransStream>, TlsServerStream<TcpTransStream>>, TcpTransStream>>
The result of a connection setup process, including protocol upgrades. Read more
Source§fn listen_on(
&mut self,
addr: Multiaddr,
) -> Result<IListener<Self::Output>, TransportError>
fn listen_on( &mut self, addr: Multiaddr, ) -> Result<IListener<Self::Output>, TransportError>
Source§fn dial<'life0, 'async_trait>(
&'life0 mut self,
addr: Multiaddr,
) -> Pin<Box<dyn Future<Output = Result<Self::Output, TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn dial<'life0, 'async_trait>(
&'life0 mut self,
addr: Multiaddr,
) -> Pin<Box<dyn Future<Output = Result<Self::Output, TransportError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn box_clone(&self) -> ITransport<Self::Output>
fn box_clone(&self) -> ITransport<Self::Output>
Clones the transport and returns the trait object.
Source§fn timeout(self, timeout: Duration) -> TransportTimeout<Self>where
Self: Sized,
fn timeout(self, timeout: Duration) -> TransportTimeout<Self>where
Self: Sized,
Adds a timeout to the connection setup (including upgrades) for all
inbound and outbound connections established through the transport.
Source§fn outbound_timeout(self, timeout: Duration) -> TransportTimeout<Self>where
Self: Sized,
fn outbound_timeout(self, timeout: Duration) -> TransportTimeout<Self>where
Self: Sized,
Adds a timeout to the connection setup (including upgrades) for all outbound
connections established through the transport.
Source§fn inbound_timeout(self, timeout: Duration) -> TransportTimeout<Self>where
Self: Sized,
fn inbound_timeout(self, timeout: Duration) -> TransportTimeout<Self>where
Self: Sized,
Adds a timeout to the connection setup (including upgrades) for all inbound
connections established through the transport.
Auto Trait Implementations§
impl Freeze for WsConfig
impl !RefUnwindSafe for WsConfig
impl Send for WsConfig
impl !Sync for WsConfig
impl Unpin for WsConfig
impl !UnwindSafe for WsConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more